Commit Graph

157 Commits

Author SHA1 Message Date
Arnaud Roques 2680086893 fix URL 2024-05-14 18:30:09 +02:00
HeinrichAD 46077bf5b7
Set `java.awt.headless` to `true` due to Windows 11 issues (#312)
* set java.awt.headless to true due to Windows 11 issues

* do not force headles mode but us it as default
2023-09-06 21:23:55 +02:00
HeinrichAD 608b58b3e0 add the same support to maps
sendMap should work similar to sendDiagram w.r.t. diagram source selection
2023-07-19 23:08:13 +02:00
HeinrichAD 5859c3b427 support diagrams without startuml, enduml
Add support for diagram without @startuml and @enduml.
2023-07-19 23:08:13 +02:00
HeinrichAD f03bb68407 add jetty "host" property
Add the posibility to set the network interface the Jetty server connector binds to as an IP address or a hostname. If null or 0.0.0.0, then its automatically binds to all interfaces.

Currently, the sercer connector uses 0.0.0.0 as fallback and always binds to all interfaces.

References: <https://eclipse.dev/jetty/javadoc/jetty-11/org/eclipse/jetty/server/AbstractNetworkConnector.html#getHost()>
2023-07-11 22:44:51 +02:00
Kálmán Vince 294b2a2418 Add diagram indexing support for all formats 2023-06-20 21:12:14 +02:00
HeinrichAD 45994f81bf remove unused import `OptionFlags` 2023-06-13 22:57:07 +02:00
HeinrichAD 4202730c11 remove ALLOW_PLANTUML_INCLUDE + update to 1.2023.9
- update Plantuml to v1.2023.9
- PlantUML core removed `OptionFlags.ALLOW_INCLUDE` and uses now the `PLANTUML_SECURITY_PROFILE`
2023-06-13 22:57:07 +02:00
HeinrichAD 09a7ce4973 add security features + java property support
- set `ALLOW_PLANTUML_INCLUDE` only once and decentralized inside the `DiagramResponse` class and call this init method after initializing the server
- set `PLANTUML_SECURITY_PROFILE` to `INTERNET` by default (BREAKING CHANGES)
- add possibility to set PlantUML system properties over a file with `PLANTUML_PROPERTY_FILE`
- adjust documentation
- add "Breaking changes" hint to README
2023-06-13 22:57:07 +02:00
HeinrichAD 5fa6cbc82f catch 400 response for broken diagrams 2023-06-12 22:57:06 +02:00
HeinrichAD 98dfd1763a create parent pom to improve the maintanace 2023-06-09 17:31:19 +02:00
Florian 155250286f Add dependency tests
- add `testGraphviz`: request `version` as AsciiArt and search for
  "Installation seems OK. File generation OK"
- irgnore `testGraphviz` inside github workflow tests except for the
  docker container tests, since only in the docker container case
  graphviz is available
- add `testMonacoEditorWebJar`: request `loader.js` and check if the
  server answers with status code 200
- add a note inside the pom where the webjar versions are hard coded
  inside the project
2023-05-19 23:12:22 +02:00
Florian 478ef3bce7 front-end code refactoring
Since the front-end received much more code (features) than first expected, the files became much too large. For this reason, the JS and CSS code has now been split by component and thus into several small files. However, since there are now many small files, a JS and CSS bundle tool had to come :D.
2023-05-19 13:55:18 +02:00
Florian 6ca582fcb7 add import and export diagram
- export diagram
  * add a diagram export dialog where you can choose the file name
    and download type (code, png, pdf, ...)
  * set default download type to code
  * open file save dialog via menu or Ctrl+S (or Meta+S for Mac)
- import diagram
  * similar to [draw.io](https://app.diagrams.net)
  * open a PlantUML diagram image, use metat data to get diagram code
    and load this diagram (Note: meta data is currently only supported
    by PNG and SVG diagram files)
  * support drag&drop
  * add diagram import dialog
- since three are now multiple options/action -> create a little
  editor menu
- add documentation (including gif examples)
2023-05-14 11:22:44 +02:00
Florian ec7b9f9b1a Add `metadata` Servlet
- add new servlet to get meta data from PlantUML diagram
- meta data get not only be requested as text but also as json if you set the `Accept`-header to json
- add `metadata` servlet tests
- GET: like the Proxy where you can pass a URL which the servlet will use to fetch the diagram image
- POST: file upload
2023-05-11 21:34:32 +02:00
Florian 09517cca92 add emoji auto completion (suggestion)
- typing `<:` will start the emoji auto complition inside the plantuml editor
- for the sake of simplicity the emoji preview of the completion documentation will fetch the image from the original github repository (not plantuml). The reason is that the images (SVGs) inside plantuml have sometimes removed their svg tag, hence it's difficult to set the correct rendering size.
- expand auto completion (suggestion) documentation by default
- add emoji example GIF and documentation
- set charset to utf-8 for each website
- refactor JSON creation inside UI Helper
2023-05-10 22:10:58 +02:00
Florian 6538be2047 fix: PDF servlet
Since the update of `bastik` the PDF servlet didn't work anymore.

Problems:
- No PDF UnitTest existed
- Pom dependency `org.apache.xmlgraphics.batik-all` change nearly every dependency to `optional` starting with version `1.15`, hence some important dependencies like the SVG converter were missing
- `DiagramResponse.CONTENT_TYPE` had no mime type value for PDF

Changes:
- add PDF UnitTest
- remove `batik-all` dependency and only include the dependencies PlantUML requires for the PDF generation:
  * batik-dom
  * batik-svgrasterizer (includes batik-dom)
  * batik-svggen
  * fop
- remove own `DiagramResponse.CONTENT_TYPE` mapping and use `FileFormat.getMimeType()`
2023-05-09 19:45:21 +02:00
Florian f0d78a146b fix mobile view
- add viewport to header (otherwise smartphones will render the desktop version)
- set focus to the code editor after loading the page
- fix some android dark mode theme issues by settings clear default for the light theme as well
2023-05-09 09:33:57 +02:00
Florian e5d11fb89a update all dependencies (maven artifacts)
- PDF dependency was missing in the pom file the JDK8
  * We should think about creating a parent pom - in that case all plantuml dependencies could be in the parent pom and we would only the mantain one pom file.
    (It is also possible to drop the Java 8 support.)
  * Why do we not have any PDF tests?
- add rule to ignore version update hint with `-dev` followed by a dot and date (e.g. `0.37.0-dev.20230308`)
- migration from JUnit4 to JUnit5
2023-05-05 17:33:39 -04:00
Florian e6566b58bd revert missing tests + small fixes
- revert the 4 missing tests, e.g. proxy test from commit 20468f5
- add virtual host name `test.localhost` to embedded jetty server
  (JUnit Tests) since localhost and IP-Addresses are no longer
  supported by the proxy and use this address inside proxy `src`
- add `test-localhost` support for the docker tests. To support
  this the docker hostname need to be set to test.localhost by:
  `--hostname=test.localhost` (only for the docker tests)
- proxy: add file format support for PDF
- proxy: add error messages on "bad request" response
- proxy: remove dead code
- old proxy: add error messages on "bad request" response
- fix incorrect README link to docs
- add `HTTP_PROXY_READ_TIMEOUT` option -- close #240
2023-05-04 18:30:58 -04:00
Florian f727c6dd13 frontend 2.0: initial version
- auto refresh function
- light and dark theme
- monaco editor (vscode) with "apex" as syntax highlighting language
  * apex seems to work quite fine (better than no highlighting)
  * future possibility: own plantuml language syntax support
  * future possibility: autocomplete (to much work but maybe partial)
    - implemented example for `!theme ...`
    - implemented example for `<&icon>`
  * future possibility: code validation
    - implemented example for `@start...` and `@end...`:
      * should be the first or last command
      * should be of the some type (e.g. `@startyaml` and @endyaml)
      * should be used exactly once per document/diagram
- editor and preview is splitable into two windows like the
  "Extract window" functionality on
  (plantuml.com)[https://www.plantuml.com/plantuml]
- multi index / multi paging diagram support
- diagram can be displayed/rended as PNG, SVG, ASCII Art or PDF
- Ctrl+s download the PlantUML Code as code file (diagram.puml)
- Ctrl+, opens the settings and Esc closes the settings
2023-05-03 13:23:47 -04:00
Florian 763976abdd add servlet to encode and decode diagrams
.
2023-04-18 23:07:59 +02:00
Arnaud Roques ebece93726 Update to version 1.2023.5 2023-04-10 16:26:56 +02:00
Florian Heinrich 638724925e Refactoring relative paths PR#209.
- use html `base` tag containing the context path once instead inside
every single URL/link.
- update and enhance `nginx-contextpath` example
- export javascript code into separated file
- Add TODO note to javascript clipboard check (from PR#250) since
Firefox and Safari do not support the current implementation
2023-03-21 14:14:09 +01:00
Florian 99f85c0c9b Use relative paths as far as possible.
Switch from absolute paths `hostpath` to relative paths `contextpath`.
Unfortunately, for the url input javascript is necessary to resolve the
relative url.
Also see Issue #205.
2023-02-24 09:26:48 +01:00
Joel Pearson 4a5e204e16 Adding PDF support #130 2023-02-17 19:43:59 +01:00
Arnaud Roques f62ba44e7d Restore https://github.com/plantuml/plantuml-server/pull/250 2023-01-15 18:08:07 +01:00
Arnaud Roques a7a5b91933 Temporary remove tests 2022-12-06 19:20:32 +01:00
Arnaud Roques 20468f5bd9 Temporary remove tests 2022-12-06 19:18:43 +01:00
Arnaud Roques 10dd88714a test 2022-12-06 19:12:57 +01:00
Arnaud Roques df9c10604a improve tests 2022-12-06 19:06:00 +01:00
Arnaud Roques 0154160c7d Improve tests 2022-12-06 18:52:30 +01:00
Arnaud Roques 4d65def8bb Improve proxy management 2022-12-06 18:42:54 +01:00
Thomas Mons cf717eff0c Introduced parameter PLANTUML_CONFIG_FILE, that allows to specify a PlantUML config file. 2022-07-29 12:49:22 +02:00
aadrian 2d011e233e The ProxyServlet should handle maps too. 2022-06-29 23:35:41 +02:00
aadrian dcc06f9afc CORS should work for imagemaps too. 2022-06-29 23:35:41 +02:00
Arnaud Roques 0330b7c4a2 Import version 1.2022.2 2022-03-07 22:36:31 +01:00
Arnaud Roques c94711c2d5 code formatting 2022-01-22 13:08:43 +01:00
Arnaud Roques b995dcdb61 Code formatting 2022-01-22 13:07:01 +01:00
Arnaud Roques 494dfba063 textarea improvement 2022-01-22 13:03:15 +01:00
Arnaud Roques 54016d325d Fully remove log4j use 2021-12-12 15:01:14 +01:00
Florian 3763ee737e Improve multipage (index) handling 2021-10-18 15:40:40 +02:00
Florian 9cb9cec6ca update jetty and tomcat to latest version 2021-10-17 18:46:03 +02:00
Mingmin Xu b1b7dfb84b enable vertical resize for input text area 2021-10-13 23:54:06 +02:00
Florian deda3c2256 update + restructure pom and add missing javadoc 2021-10-13 12:25:18 +02:00
Florian 098e630a28 update and fix checkstyle and javadoc plugins 2021-10-11 19:22:18 +02:00
Florian 8d5be87f03 update junit test classes and there dependencies 2021-10-11 18:43:18 +02:00
Florian Heinrich 6cb587e156 Use `hostpath` consistently. 2021-06-01 11:43:47 +02:00
Arnaud Roques 9bc56edca6 Fix security #122 2019-09-26 19:13:07 +02:00
Arnaud Roques 83138142c5 Fix security #122 2019-09-26 19:08:48 +02:00