Giter VIP home page Giter VIP logo

jdl-studio's Introduction

JDL-Studio

Hello, this is JDL-Studio, an online tool for drawing UML diagrams for JHipster based on the JDL syntax. It tries to keep its syntax visually as close as possible to the generated UML diagram without resorting to ASCII drawings.

Created by Deepu KS. Heavily inspired and adapted from nomnoml

JDL-Studio was made possible by these cool projects

Docker image

The official Docker image is available at https://hub.docker.com/r/jhipster/jdl-studio/

You can use JDL-Studio offline with :

docker run --rm -it -p 18080:80 jhipster/jdl-studio

The JDL-Studio should be available at: http://localhost:18080 or http://docker-ip:18080

Web application

The JDL-Studio web application is a simple editor with a live preview. It is purely client side and changes are saved to the browser's localStorage, so your diagram should be here the next time, (but no guarantees).

Interaction

The canvas can be panned and zoomed by dragging and scrolling in the right hand third of the canvas. Downloaded image files will be given the filename in the #title directive.

syntax

The JDL syntax is explained here

Directives

#arrowSize: 1
#bendSize: 0.3
#direction: down | right
#gutter: 5
#edgeMargin: 0
#edges: hard | rounded
#background: transparent
#fill: #eee8d5; #fdf6e3
#fillArrows: false
#font: Calibri
#fontSize: 12
#leading: 1.25
#lineWidth: 3
#padding: 8
#spacing: 40
#stroke: #33322E
#title: filename
#zoom: 1
#acyclicer: greedy
#ranker: network-simplex | tight-tree | longest-path

Contributing

If you want to contribute to the project more info is available in CONTRIBUTING.md.

Development

This project was bootstrapped with Create React App. There are two important GIT branches. src branch holds the source code and all development needs to be done against that branch. gh-pages branch holds the deployable static site that is built from src.

Use npm i --legacy-peer-deps when installing to avoid peer dependency conflicts

Deploy to production

In order to deploy to production run npm run deploy, this will build the src branch and move the assets to the gh-pages branch and push it to GitHub, it will update the https://www.jhipster.tech/jdl-studio/ version and will create a PR to update the https://start.jhipster.tech

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console. Make sure npm install is run before running npm start

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

jdl-studio's People

Contributors

bagage avatar clakech avatar ctamisier avatar danielfran avatar decampsrenan avatar deepu105 avatar dependabot[bot] avatar falydoor avatar jdubois avatar jhipster-bot avatar kaidohallik avatar mathieuaa avatar pascalgrimaud avatar ruddell avatar scarabetta avatar sendilkumarn avatar sonialahi avatar sudharakap avatar vishal423 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jdl-studio's Issues

Saving image can not be seen when is big and you zoom

Hi,

Great program, that could be even better.

When you have a big jhipster-jdl.png with lots of entities and you zoom, I can not move it to the edges (in Chrome, but it moves in Opera 8-0). It always stays at the middle of the screen.

So I download it as PNG, but the when I open it and zoom it. It does not have enough resolution.

If there is any solution, please let me know. I attach an example.

jhipster-jdl 3

Thanks

Allow to extend entity from abstract entity

I want to create the following entity model using JDL Studio:

Petclinic UML

But I don't have the necessary JDL syntax to extends my Owner entity and my Vet entity from an abstract entity called AbstractPerson.

Eclipse, IDEA, WebStorm and Web Editor

Hello,

We are currently making a JDL editor for Eclipse, IDEA, WebStorm and web browsers. The Editor is based on xtext and will hopefully be ready soon.

https://github.com/jbadeau/jdl

The editor currently supports:

  • Syntax Coloring
  • Semantic Coloring
  • Error Checking
  • Auto-Completion
  • Formatting
  • Hover Information
  • Mark Occurences
  • Go To Declaration
  • Rename Refactoring
  • Debugging
  • Toggle Comments
  • Outline / Structure View
  • Quick Fix Proposals
  • Find References
  • Call Hierarchy
  • Type Hierarchy
  • Folding

Hopefully this is a smoother experience for people who want to edit JDL locally.

Make relationship with Jhipster Auhtority

Hello i would like to create a relationship between a custom entity which need to have a user authority to know who can access to the element of the entity.

But JDL-Studio don't recognize this jhipster's class. It's possible to have access to this class in JDL-Studio ?

In the meantime I am using a workaround to generate the data model but I cannot generate the application with the JDL.

I create a entity Authority like the jhi-authority :

entity Authority {
name String required
}

And i make my relationship with that :

relationship [Your relationship]{
[Entity Name]{authority} to Authority
}

Online version at https://start.jhipster.tech/jdl-studio/ differs from offline-version either docker image or in tomcat container from branches gh-pages or jhipster-online

Hi,

Following occurs when calling the docker image by:

docker run --rm -it -p 18080:80 jhipster/jdl-studio

or cloning the github to a tomcat container (on Ubuntu i.e.)

  1. I get a message:
Warning!
You are using an old version of JDL Studio. Please use our new URL at: https://start.jhipster.tech/jdl-studio/
  1. I cannot use the import function, which in case of the online-version
    https://start.jhipster.tech/jdl-studio/
    works brilliantly and opens a "Open File Dialogue" window!

  2. This is the same for both of the branches gh-page as well as jhipster-online.

Could there be probably a commit missing?

Regards
Peter

Cannot import jdl generated .jh file to create entities

I'm trying out jdl-studio but every time I attempt to import a .jh file generated by JDL Studio I get an error: Cannot find module 'jhipster-jdl.jh'

I am up to date on all npm modules. I am using the defaults when generating the app with "yo jhipster", apart from using Postgres rather than Mysql.

The full stack of the error is:

▶ yo -v jhipster:import-jdl jhipster-jdl.jh
module.js:327
    throw err;
    ^

Error: Cannot find module 'jhipster-jdl.jh'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.require.resolve (internal/module.js:16:19)
    at Environment.resolveModulePath (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:453:18)
    at Environment.register (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:161:25)
    at Environment.getByPath (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:272:10)
    at Environment.get (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:261:10)
    at Environment.create (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:292:24)
    at Environment.run (/usr/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:364:24)
    at /usr/lib/node_modules/yo/lib/cli.js:140:11
    at Array.forEach (native)

The error implies that yeoman cannot find the file, but its definitely in the root of the project:

▶ l
total 136K
drwxr-xr-x.   6 mhalma mhalma 4.0K May 20 21:04 .
drwxrwxr-x.   4 mhalma mhalma   32 May 20 21:01 ..
-rw-r--r--.   1 mhalma mhalma 1.2K May 20 21:02 bower.json
-rw-r--r--.   1 mhalma mhalma   56 May 20 21:02 .bowerrc
-rw-r--r--.   1 mhalma mhalma 7.5K May 20 21:02 build.gradle
-rw-r--r--.   1 mhalma mhalma  475 May 20 21:02 .editorconfig
-rw-r--r--.   1 mhalma mhalma  196 May 20 21:02 .eslintignore
-rw-r--r--.   1 mhalma mhalma  687 May 20 21:02 .eslintrc.json
-rw-r--r--.   1 mhalma mhalma  447 May 20 21:02 .gitattributes
-rw-r--r--.   1 mhalma mhalma 1.8K May 20 21:02 .gitignore
drwxr-xr-x.   3 mhalma mhalma 4.0K May 20 21:02 gradle
-rw-r--r--.   1 mhalma mhalma 2.3K May 20 21:02 gradle.properties
-rwxr-xr-x.   1 mhalma mhalma 5.0K May 20 21:02 gradlew
-rw-r--r--.   1 mhalma mhalma 2.3K May 20 21:02 gradlew.bat
drwxr-xr-x.   2 mhalma mhalma   89 May 20 21:02 gulp
-rw-r--r--.   1 mhalma mhalma 7.5K May 20 21:02 gulpfile.js
-rw-r--r--.   1 mhalma mhalma  802 May 20 21:04 jhipster-jdl.jh
drwxr-xr-x. 878 mhalma mhalma  24K May 20 21:03 node_modules
-rw-r--r--.   1 mhalma mhalma 1.7K May 20 21:02 package.json
-rw-r--r--.   1 mhalma mhalma 2.8K May 20 21:02 README.md
-rw-r--r--.   1 mhalma mhalma   27 May 20 21:02 settings.gradle
drwxr-xr-x.   4 mhalma mhalma   28 May 20 21:02 src
-rw-r--r--.   1 mhalma mhalma  348 May 20 21:02 .travis.yml
-rw-r--r--.   1 mhalma mhalma  715 May 20 21:02 .yo-rc.json

It is worth noting that my OS is centos and I have to use sudo when installing global npm modules otherwise I get various errors. This may be related as I wonder if it is a permission problem. However everything in my project root is owned by the user I am creating the app with, including the .jh file.

Any clues? Not looking forward to debugging yeoman!

Can I create a entity with a different name?

Hello.
I was impressed with jHipster and JDL-studio.

I'm using your tools at my works: designning entities with jdl studio.
Is it possible to use entity name differently? @Entity (name = 'diffenertName').
I looked at the keyword token, but I do not find that reserved word.

SkipClient error while parsing with recommended syntax in studio

Hello,

I want to use the skipClient. Based on issue #10 it should be supported.
When I use it like that (with for all)
jdl-studio-02
and when I import it with jhipster import-jdl jhipster-jdl.jh I get the following error:

The JDL is being parsed.
error: Error message:
	NoViableAltException: Expecting: one of these possible Token sequences:
  1. ['@']
  2. ['entity']
  3. [COMMENT, 'entity']
  4. ['relationship']
  5. ['enum']
  6. ['dto']
  7. ['paginate']
  8. ['service']
  9. [COMMENT]
  10. ['microservice']
  11. ['search']
  12. ['skipClient']
  13. ['skipServer']
  14. ['angularSuffix']
  15. ['noFluentMethod']
  16. ['filter']
  17. ['clientRootFolder']
  18. ['application']
  19. [NAME]
but found: 'all'
	at line: 10, column: 16

So I tried like that:
jdl-studio-01

and in that case it works but there is a warning message in the studio.
Here is my jhipster version:

Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

##### **JHipster Version(s)**

/home/djay
└── [email protected]



##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.3.4",
    "applicationType": "monolith",
    "baseName": "srv1",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en"
    ]
  }
}
</pre>
</details>


##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>
entity Region {
  regionName String
}
dto Region with mapstruct
service Region with serviceImpl

</pre>
</details>


##### **Environment and Tools**

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

git version 2.18.0

node: v8.11.4

npm: 6.4.1

yeoman: 2.0.4

yarn: 1.9.4

Docker version 18.06.1-ce, build e68fc7a215

docker-compose version 1.22.0, build f46880fe

Congratulations, JHipster execution is complete!

Let me know if you need something else.

JDL-Studio no showing model errors

Hi folks,

As I remember JDL-Studio was showing your script errors at the bottom of the screen using a red text message.
For some reason it is not happening anymore.
It's easy to repeat, just write some wrong jdl and check with the console.
Some screenshots for Firefox follows,
Thanks for the excellent tool.

jdl-studio-noerror

jdl-studio-console

JDL-Studio diagram reload fail (with imported JDL)

If I don't dismiss or close Warning! on https://www.jhipster.tech/jdl-studio/ I am redirected to https://start.jhipster.tech/jdl-studio/, where diagram reload is not working with error in console.

Uncaught Error: MismatchedTokenException: Expecting --> '}' <-- but found --> '(' <-- at line: 2, column: 37 at https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:11:26214 at Object.parse (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:11:26228) at Object.nomnoml.intermediateParse (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:25:6945) at Object.nomnoml.parse (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:25:6820) at r (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:25:16851) at Object.nomnoml.draw (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:25:17186) at M (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:25:21200) at r (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:2:12015) at u (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:2:12280) at s (https://start.jhipster.tech/jdl-studio/dist/js/main-b6f2b2b293.js:2:12226)

image

There is ok
image

It's exported .jh

change selection color

When editing the DSL, I verz often use the keyboard or mouse to select muliple characters/words/lines. Unfortunate this selection is not verz wel visible because of the colors choosen. The the color of the selected text is to close to the background color of the editor (black on black).

In The sample.jh File, Those OneToOne relationships Shall Be ManyToOne Instead

The sample JDL doesn't interpret the original model (http://wiki.joanillo.org/images/4/48/Hr_main.txt) correctly. For example, the relationship between Country and Region isn't one-to-one although there isn't a cross reference table in the original DB schema. It shall be many-to-one instead. All of those one-to-one relationships shall be many-to-one instead.

BTW, I have made related changes, but I unable to create a branch and push my changes.

Error importing jdl microservice to gateway

Hi i have error when importing jdl microservice to gateway.
01
02
03

mi jdl microservice

entity Cliente{
nombre String required,
apellido String required,
celular String,
telefono String required,
email String required,
domicilio String required,
colegio String required
}

entity Modelo{
imagen ImageBlob required,
nombreModelo String required,
colorVestido String required,
observacion String required
}

entity Medida{
contornoBusto Double,
anchoPecho Double,
altoBusto Double,
bajoBusto Double,
alturaPinza Double,
separacionBusto Double,
talleDeltantero Double,
talleEspalda Double,
largoCorset Double,
costado Double,
hombro Double,
anchoHombro Double,
largoManga Double,
sisaDelantero Double,
sisaEspalda Double,
contornoCintura Double,
anteCadera Double,
contornoCadera Double,
posicionCadera Double,
largoFalda Double,
tipoFalda TipoFalda,
fechaMedida LocalDate required,
anchoHombro Double,
anchoEspalda Double,
largoManga Double,
anchoManga Double,
tiroPantalon Double,
anchoPinzaPantalon Double,
anchoRodillaPantalon Double,
botaPantalon Double,
largoPantalon Double
}

entity Encargo{
importeTotal Double required,
fechaEncargo LocalDate required,
fechaEntrega LocalDate,
detalleVestido String required,
estado Estado,
tipoEncargo TipoEncargo
}

entity Pago{
fechaPago LocalDate,
importe Double required,
detalle String required,
numeroRecibo Integer required
}

enum Estado {
ENCARGADO, CORTADO, PROBADO, ENTREGADO, CANCELADO
}

enum TipoEncargo{
QUINCE, NOVIA, MADRINA, FIESTA, POLICIA
}

enum TipoFalda{
TUBO, RECTA, TAJO, EVASE, CORTEA, CAMPANA, PLATO, GAJOS
}

/**

  • Relacion Una empresa tiene uno o muchos usuarios
    */
    relationship OneToMany {
    Cliente{modelo(nombre)} to Modelo{cliente(nombre) required},
    Cliente{medida(nombre)} to Medida{cliente(nombre) required},
    Cliente{encargo(nombre)} to Encargo{cliente(nombre) required},
    Encargo{pago} to Pago{encargo required}
    }

paginate Cliente with pager
paginate Encargo with pager
paginate Modelo with pager

/**relationship OneToOne{
*Cliente{user} to User{cliente}
*}
*/

Mi jdl gateway app

entity Cliente

entity Modelo

entity Medida

entity Encargo

entity Pago

microservice Cliente with anelapi
microservice Modelo with anelapi
microservice Medida with anelapi
microservice Encargo with anelapi
microservice Pago with anelapi

TODO

current todos in order of priority:

  • more syntax highlighting for:
    • attribute Types
    • validation keywords
  • autocompletion for keywords, types and entered object names -done
  • add floating buttons to insert entity|relationship|enum template blocks
  • import JDL from file - done
  • A light theme switcher to have original nomnoml theme
  • ability to convert XMI to JDL if possible - this will be done in Jhipster UML project
  • switch to SVG from canvas if possible so that we can do some drag and drop stuff easily

https://start.jhipster.tech/jdl-studio doesn't load properly

Hi, I'm not sure if this is the correct place for this type of issue (i couldn't make an issue on the actual site repo) but going directly to the above url causes jdl-studio not to load. It only loads properly when clicking the link from https://www.jhipster.tech/jdl-studio/

This occurs both in the latest version of chromium and firefox on Windows 10.

Errors from chromium:

Refused to apply style from 'https://start.jhipster.tech/dist/css/main-a21cc2c07a.css' because its MIME type ('application/json') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

logo-jhipster.png Failed to load resource: the server responded with a status of 404 (Not Found)

main-867bacaa96.js Failed to load resource: the server responded with a status of 404 (Not Found)

jdl-studio:1 Refused to execute script from 'https://start.jhipster.tech/dist/js/main-867bacaa96.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

jdl-studio:1 Refused to apply style from 'https://start.jhipster.tech/dist/css/main-a21cc2c07a.css' because its MIME type ('application/json') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Errors from Firefox:

Loading failed for the <script> with source “https://start.jhipster.tech/dist/js/main-867bacaa96.js”.

After saving jdl the url transforms to jdl-studio/#!/view/undefined and cannot move the diagram anymore

Used chrome browser.

The chrome console shows the following error 👍

Error in event handler for (unknown): TypeError: Cannot read property 'trace' of undefined
at browser.runtime.sendMessage.response (chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js:1250:20)
polyfill.js:123 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
at Object.value [as sendMessage] (polyfill.js:92)
at initializeComposer (composer.postload.js:578)
at Object. (composer.postload.js:590)
at webpack_require (bootstrap 99b35345c5f7aa4bdb88:19)
at Object. (bootstrap 99b35345c5f7aa4bdb88:62)
at webpack_require (bootstrap 99b35345c5f7aa4bdb88:19)
at bootstrap 99b35345c5f7aa4bdb88:62
at bootstrap 99b35345c5f7aa4bdb88:62
3app.js:247 Uncaught TypeError: de.diff is not a function
at HTMLDivElement.y (app.js:247)

After this, I cannot move the diagram anymore and I need to refresh the page

Please check and see if you can find anything to solve this.

Thanks a lot!!

Add syntax highlighting for restricted database keywords

I added an attribute called 'from' to an entity and wanted to change my database from mongodb to mysql. My JUnit-Tests failed and I did not know why they failed. After some time I remembered I used 'from' as an attribute name. I renamed it and it work.
So I thought it would be nice with the jdl studio syntax shows some reversed keywords from database. What do you think?

gulp build starting from jhipster-core V1.2.3 fails

Overview of the issue

Starting from jhipster-core version v1.2.3 JDL Studio gulp build fails with error:

events.js:160
      throw er; // Unhandled 'error' event
      ^
Error
    at new JS_Parse_Error (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:1526:18)
    at js_error (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:1534:11)
    at parse_error (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:1647:9)
    at Object.next_token [as input] (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:1912:9)
    at next (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2012:25)
    at eval (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2134:42)
    at eval (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2073:24)
    at block_ (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2353:20)
    at eval (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2326:25)
    at function_ (eval at <anonymous> (c:\projects\kaido-github\jdl-studio\node_modules\uglify-js\tools\node.js:22:1), <anonymous>:2331:15)

Reproduce the error

  • fork and clone JDL Studio
  • in bower.json change from
"pegjs_parser": "https://raw.githubusercontent.com/jhipster/jhipster-core/v1.1.5/lib/dsl/pegjs_parser.js",

to (error occurs with versions 1.2.3 and 1.2.4)

"pegjs_parser": "https://raw.githubusercontent.com/jhipster/jhipster-core/v1.2.4/lib/dsl/pegjs_parser.js",

hint: can reference to local version, for example if jhipster-core and jdl-studio are cloned into same parent folder then reference is:

"pegjs_parser": "../jhipster-core/lib/dsl/pegjs_parser.js",
  • bower install
  • gulp build

Related issues

At first opened that in jhipster-core project jhipster/jhipster-core#98

Suggest a Fix

After debugging gulpfile.js with
.pipe(gulpIf('*.js', uglify().on('error', function(e){console.log(e);})))
found that error occurs in line
peg$c73 = function(head, tail) { return `${head}${tail.join('')}`; },
error is:
Unexpected character \'`\'

Seems that changes from jhipster-core commit used more ES2015 features is causing this.

Seems that must add ES2015 support to JDL Studio gulpfile.js.
Googling results that Babel is suitable for that, in package.json add "gulp-babel": "6.1.2" and in gulpfile.js add babel = require('gulp-babel')

  1. Babel can be used with babel-preset-es2015, in package.json add "babel-preset-es2015": "6.18.0" and in gulpfile.js add .pipe(babel({presets: ['es2015']})).pipe(uglify())
  2. Babel can be used with babili like that: .pipe(babel({presets: ['babili']}))

Additional note: starting from jhipster-core version v1.2.3 JDL internal comments //..... are not parsed with pegjs_parser.js any more. These are removed before passing JDL to pegjs_parser.js. It's possible that must adapt that change separately in JDL Studio.

Change coloration of bulk-option setting

Hi, if you modify the JDL so that the option settings are:

paginate * with pagination
dto * with mapstruct
service * with serviceClass

You see:

Image

Which shouldn't be grey-ed, but like this:

Image2.

Ambigious syntax errors

I am getting this error when I try to import my jdl into my project:

$ jhipster import-jdl ./Assets/jhipster-jdl.jh --serverOnly
Using JHipster version installed globally
Executing jhipster:import-jdl ./Assets/jhipster-jdl.jh
Options: serverOnly: true, server-only: true
The JDL is being parsed.
Error: Valid source and destination entities are required.
ERROR! ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required.
Error: ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required.
    at Environment.error (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
    at module.exports.error (/usr/local/lib/node_modules/generator-jhipster/generators/generator-base.js:1978:18)
    at module.exports.importJDL (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:115:14)
    at new ImporterGenerator (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:80:38)
    at new module.exports (/usr/local/lib/node_modules/generator-jhipster/generators/import-jdl/index.js:122:9)
    at Environment.instantiate (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:408:12)
    at Environment.create (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:386:17)
    at Environment.run (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:443:28)
    at runYoCommand (/usr/local/lib/node_modules/generator-jhipster/cli/cli.js:63:13)
    at Command.command.allowUnknownOption.description.action (/usr/local/lib/node_modules/generator-jhipster/cli/cli.js:83:13)

I believe this a syntax error but it doesn't point to a line number and from eye-balling my file there doesn't seem to be any syntax issues. Here's my jdl:

entity Address {
	StreetNumber Integer,
    HouseName String,
    StreetNumberSuffix String,
    StreetName String,
    StreetType String,
    StreetDirection String,
    AddressType String,
    AddressTypeIdentifier String,
    LocalMunicipality String,
    CityTown String,
    GoverningDistrict String,
    PostalArea String,
    Country String,
    Latitude String,
    Longitude String
}

entity HomeInfo {
	HomestayName String,
    HomestayShortDescription String,
    HomestayDescription String
}

entity Room {
	RoomName String,
    SquareFootage Float,
    HasRefrigirator Boolean,
    PrivateBathroom Boolean
}

entity Pricing {
	Price BigDecimal,
    BeginDate ZonedDateTime,
    EndDate ZonedDateTime
}

entity RoomImage {
	Name String,
	Alt String,
	File ImageBlob,
	UploadDate ZonedDateTime,
    FileUrl String,
}

entity HouseImage {
	Name String,
    Alt String,
    File ImageBlob,
    UploadDate ZonedDateTime,
    FileUrl String,
}

entity PersonImage {
	Name String,
    Alt String,
    File ImageBlob,
    UploadDate ZonedDateTime,
    FileUrl String
}

entity Payment {
	TimeStamp Instant,
    Method String,
}

entity Person {
    FirstName String,
    Surname String,
    PreferredLanguage String,
    Age Integer
}

entity Reservation {
    StartDate ZonedDateTime,
    EndDate ZonedDateTime,
    TimeStamp ZonedDateTime
}

entity Host {
	MembershipType String,
  	SignUpDate ZonedDateTime,
  	ResignationDate ZonedDateTime
}

entity Student {
  	LookingToStudy String,
  	School String,
  	PriceMin BigDecimal,
  	PriceMax BigDecimal,
  	StudyingInCity String,
  	SignUpDate ZonedDateTime,
  	ResignationDate ZonedDateTime
    Interests String
}

entity Activity {
	TimeStamp ZonedDateTime,
    ActionType String
}

entity Pet {
	Name String,
    Species String,
    Hypoallergenic Boolean
}

relationship OneToOne {
	Host to Person,
    Student to Person,
    Address to Person,
    Reservation to Host,
    Reservation to Student,
    Reservation to Address,
    HomeInfo to Address,
    Payment to Reservation
}

relationship OneToMany {
	HomeInfo to Room,
    Room to RoomImage,
    Person to PersonImage,
    HomeInfo to HomeImage,
    HomeInfo to Pet,
    Room to Pricing,
    Host to Reservation,
    Student to Reservation,
    Person to Activity,
    Person to PersonImage,
    Room to RoomImage,
    Address to HouseImage
}

Any ideas?

EDIT ---
Found the error on my relationships:

relationship OneToOne {
    Host to Person,
    Student to Person,
    Address to Person,
    HomeInfo to Address,
    Payment to Reservation
}

relationship OneToMany {
	HomestayInfo to Room,
    Room to RoomImage,
    Person to PersonImage,
    HomeInfo to HouseImage,
    HomeInfo to Pet,
    Room to Pricing,
    Host to Reservation,
    Student to Reservation,
    Person to Activity,
    Address to HouseImage
}

Create a small server backend so that the JDLStudio can be used as a local file editor

The idea is that people can run the JHipster studio with a "binary" (maybe published on NPM, or with docker). Then doing something like ‘jdl-studio entity.jh‘ will start a small server that serve the JDL-Studio front-end and synchronize it with the jdl file.

This could also be a way for a user to visualize all the app entities, once @cbornet's JSON reversing is done.

To me it seems a better solution than creating an editor specific plugin.

Maybe @flaviencathala can work on this, I think you will need a break from the angular migration from time to time. If nobody sees any objection to do this ?

Add Default Value For Fields in JDL

Please considering adding the ability to specific a default value in the .jdl file.

Use Case:
At design time, while working on the .jdl file, hints can be provided for the UI. If there is a default value for a field, that value can be sent both to db when the tables are created and to the generated UI. Hence, making it easier for the default to enforce the design.

Example:
entity A{
quantity Integer required min(10) max(100) default(10),
model String required default("basic"),
count Long default(0)
}

Tabs to spaces

The editor should convert any tab I enter t 4 spaces to matches what is resulting from 'enter' that automatically indent with for spaces after an open bracket

Show exception's line number

Hello,
the tool does display an exception when it occurs for example
"Expected a space but "_" found.".

but it doesn't not show any line number related to this exception.

Unsupported skipClient and skipServer?

The docs state that

With JHipster, you can also tell whether you don’t want any client code, or server code. Even if you want to add a suffix to Angular-related files, you can do that in JHipster. In your JDL file, simply add these lines to do the same:

but doing so in jdl-studio generates:

Expected "/*", "//", "dto", "entity", "enum", "paginate", "relationship", "service", a space or end of input but "s" found. -> line: 25

Directives - renderer image style not working

Hi team,

I notice that directives for renderer image style not working any more.
To reporduce, clean workspace and use default sample.
Add theses lines from documentation helping :

#arrowSize: 1
#bendSize: 0.3
#direction: down | right
#gutter: 5
#edgeMargin: 0
#edges: hard | rounded
#fill: #eee8d5; #fdf6e3
#fillArrows: false
#font: Calibri
#fontSize: 12
#leading: 1.25
#lineWidth: 3
#padding: 8
#spacing: 40
#stroke: #33322E
#title: filename
#zoom: 1

But no changes in renderer or snapshot image downloaded.

thanks !

Support Filter Keyword

JDL Studio doesn't support the filter keyword released in jhipster-core v1.3.6

entity BankAccount {
        name String,
        amount Double
}
service BankAccount with serviceClass
filter BankAccount

MismatchedTokenException when using "with jpaDerivedIdentifier"

When trying out the sample jdl snippet from "https://www.jhipster.tech/jdl/#jdlrelationships:"

entity Citizen
entity Passport
relationship OneToOne {
  Citizen to Passport
}

// using @MapsId
relationship OneToOne {
      Citizen to Passport with jpaDerivedIdentifier 
}

and adding this at "https://start.jhipster.tech/jdl-studio/#!/view/" I receive a
MismatchedTokenException: Expecting --> 'to' <-- but found --> 'jpaDerivedIdentifier' <-- at line: 9, column: 26

Relation display should be aware of its position in relation to entities

The relation information seems to always be displayed on the top-right side of the relational arrow.
This becomes a problem when the arrow connects to the left side of an entity.
The relation arrow(s) should know the spatial relation between the connected entities and position the relation info accordingly (left/right and top/bottom).
I'm attaching example image generated for following data using http://www.jhipster.tech/jdl-studio/ (Chrome)

entity SomeTable {somtheing Bigint,somtethnigElse String}
entity SomeOtherTable {somtheing Bigint,somtethnigElse String}
entity YetAnotherTable {somtheing Bigint,somtethnigElse String}
entity RandomTable {somtheing Bigint,somtethnigElse String}
entity NotReallyATable {somtheing Bigint,somtethnigElse String}
relationship OneToOne {SomeOtherTable to SomeTable}
relationship ManyToOne {YetAnotherTable to SomeTable}
relationship ManyToMany {RandomTable to SomeTable}
relationship ManyToMany {NotReallyATable to SomeTable}

ex

Error deploying to heroku with simple .jh model

A create a project using Jhipster 6.4.1 and import this .jh model to it.

When I deployed to heroku it crashes. Sometimes it works sometimes it doesn´t.

Here it is the model used

entity AppUser {
  name String,
  lastName String,
  authorityType Integer required,
  status Integer
}
entity Comorbiditie {
  description String required,
  deleted Boolean
}
entity ComorbiditiesPatient {
  description String,
  exist Boolean required,
  comorbiditieRelation Long
}
entity DepressiveSymptom {
  description String required,
  code String,
  deleted Boolean
}
entity DepressiveSymptomsSession {
  description String,
  exist Boolean required,
  depressiveSymptomRelation Long
}
entity FinalAssessment {
  smoking String,
  weight String,
  size String,
  iMC String,
  hbiac String,
  baselineFunctionalCapacity String,
  lDL String,
  hDL String,
  cardiovascularRisk String,
  isWorking Boolean,
  deceased Boolean,
  abandonment Boolean,
  abandonmentMedicCause Boolean,
  hospitalized Boolean,
  deleted Boolean,
  reevaluation Boolean,
  executionDate ZonedDateTime
}
entity IncomeDiagnosis {
  description String required,
  deleted Boolean
}
entity IncomeDiagnosisPatient {
  description String,
  exist Boolean required,
  incomeDiagnosisRelation Long
}
entity InitialAssessment {
  smoking String required,
  weight String required,
  size String required,
  iMC String required,
  hbiac String,
  baselineFunctionalCapacity String,
  lDL String,
  hDL String,
  cardiovascularRisk String,
  deleted Boolean
}
entity MayorEvent {
  description String required,
  code String,
  deleted Boolean
}
entity MayorEventsSession {
  description String,
  exist Boolean required,
  mayorEventRelation Long
}
entity MinorEvent {
  description String required,
  code String,
  deleted Boolean
}
entity MinorEventsSession {
  description String,
  exist Boolean required,
  minorEventRelation Long
}
entity NonSpecificPain {
  description String required,
  code String,
  deleted Boolean
}
entity NonSpecificPainsSession {
  description String,
  exist Boolean required,
  nonSpecificPainsSessionRelation Long
}
entity Patient {
  code String required,
  age Integer required,
  sex String required,
  ocupation String required,
  lastEventOcurred Integer required,
  deceased Boolean,
  abandonment Boolean,
  abandonmentMedicCause Boolean,
  rehabStatus Integer,
  sessionNumber Integer,
  deleted Boolean,
  scholarship String
}
entity RehabilitationCenter {
  name String required,
  telephone String,
  deleted Boolean,
  status Integer
}
entity RehabilitationGroup {
  name String required,
  creationDate Instant,
  programStatus Integer,
  deleted Boolean
}
entity Session {
  code String required,
  executionDate Instant required,
  abscence Boolean,
  hospitalization Boolean,
  status Integer,
  deleted Boolean,
  currentlyWorking Boolean
}
relationship OneToMany {
  RehabilitationCenter{appUser} to AppUser{rehabilitationCenter},
  RehabilitationCenter{comorbiditie} to Comorbiditie{rehabilitationCenter},
  InitialAssessment{comorbiditiesPatient} to ComorbiditiesPatient{initialAssessment},
  RehabilitationCenter{depressiveSymptom} to DepressiveSymptom{rehabilitationCenter},
  Session{depressiveSymptomsSession} to DepressiveSymptomsSession{session},
  Patient{finalAssessment} to FinalAssessment{patient},
  RehabilitationCenter{incomeDiagnosis} to IncomeDiagnosis{rehabilitationCenter},
  InitialAssessment{incomeDiagnosisPatient} to IncomeDiagnosisPatient{initialAssessment},
  Patient{initialAssessment} to InitialAssessment{patient},
  RehabilitationCenter{mayorEvent} to MayorEvent{rehabilitationCenter},
  Session{mayorEventsSession} to MayorEventsSession{session},
  RehabilitationCenter{minorEvent} to MinorEvent{rehabilitationCenter},
  Session{minorEventsSession} to MinorEventsSession{session},
  RehabilitationCenter{nonSpecificPain} to NonSpecificPain{rehabilitationCenter},
  Session{nonSpecificPainsSession} to NonSpecificPainsSession{session},
  RehabilitationCenter{rehabilitationGroup} to RehabilitationGroup{rehabilitationCenter},
  Patient{session} to Session{patient}
}
relationship ManyToOne {
  AppUser{user(login)} to User
}
relationship ManyToMany {
  RehabilitationGroup{patient} to Patient{rehabilitationGroup}
}

dto AppUser, Comorbiditie, ComorbiditiesPatient, DepressiveSymptom, DepressiveSymptomsSession, FinalAssessment, IncomeDiagnosis, IncomeDiagnosisPatient, InitialAssessment, MayorEvent, MayorEventsSession, MinorEvent, MinorEventsSession, NonSpecificPain, NonSpecificPainsSession, Patient, RehabilitationCenter, RehabilitationGroup, Session with mapstruct
paginate AppUser, Comorbiditie, ComorbiditiesPatient, DepressiveSymptom, DepressiveSymptomsSession, FinalAssessment, IncomeDiagnosis, IncomeDiagnosisPatient, InitialAssessment, MayorEvent, MayorEventsSession, MinorEvent, MinorEventsSession, NonSpecificPain, NonSpecificPainsSession, Patient, RehabilitationCenter, RehabilitationGroup, Session with infinite-scroll

It should not crash since I am just using this model and adding it using jhipster import-jdl my_file1.jdl
The error only occurs after I import the .jdl file and create the entities.
The error I keep getting when I deployed to heroku is the following:

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditEventsEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/audit/AuditEventsEndpointAutoConfiguration.class]: Unsatisfied dependency expressed through method 'auditEventsEndpoint' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customAuditEventRepository' defined in URL [jar:file:/app/target/cardio-rehab-cr-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/aditum/cardiorehabcr/repository/CustomAuditEventRepository.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceAuditEventRepository': Cannot create inner bean '(inner bean)#52fc5eb1' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager';...

Directives: Background Color

There are many nice options to customize the rendered image style. I'd like to suggest to also allow changing the background color.

Expected a space but "_" found. -> line: 4

entity Document {
id Long,
name String,
file_content String,
file_content_content_type String,
created_on ZonedDateTime,
file_path String,
size String,
url String,
template_id Long,
change_on ZonedDateTime
}

entity Document_page {
id Long,
file_path String,
page_number Long,
thumb String,
url String,
document_id Long
}

entity Field {
id Long,
name String,
page_number Long,
page_format_id String,
url String,
template_id Long
}

entity Template {
id Long,
name String,
created_on ZonedDateTime
}

entity Field_format {
id Long,
name String,
example String,
allowed String
}

entity Field_value {
id Long,
value String,
document_id Long
}

entity Config{
id Long,
file_repo_dir_read String,
file_repo_dir_write String,
url_dir_read String,
url_dir_write String
}
relationship OneToOne {
Document{document} to Document_page
}
relationship OneToOne {
Field{field} to Field_format
}
relationship ManyToOne {
Field{template} to Template
}
relationship ManyToOne {
Field_value{document} to Document
}
relationship ManyToOne {
Document{Template} to Template
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.