plantuml / plantuml-server

PlantUML Online Server
https://plantuml.com/
GNU General Public License v3.0
1.67k stars 477 forks source link

Allow the upload of multiple files, which include each other #147

Open neumantm opened 4 years ago

neumantm commented 4 years ago

It would be great if there was a way to compile a project containing multiple files, that include each other.

neumantm commented 4 years ago

This could for example be achieved by allowing to upload an archive file of some form, unpacking it to a temporary directory and using a SourceFileReader on the main file.

One possibility to allow these file uploads would be to extend the functionality of the net.sourceforge.plantuml.servlet.UmlDiagramService.doPost(HttpServletRequest, HttpServletResponse) method. It could accept a json, which contains these fields: isMultiFile: boolean, umlString: String (in case it is not a multi file request), masterFile: String (in case it is a multi file request; this is the path in the archive to the file to actually compile), archiveBlob: String(base64encoded archive file (for example tar archive))

In order to not break backwards compatibility, this 'JSON-Mode' should be turned off by default and the endpoint should use raw text as it does now. But the JSON-Mode could be turned on by for example a URL-Parameter or simply by the Content-Type HTTP Header Field.

neumantm commented 4 years ago

I'll start working on PR.

arnaudroques commented 4 years ago

Why not... However, it would be nice if you could build this into a brand new servlet and access point (something like /plantuml/json ) It would allow a clear separation between actual behaviour and the new JSON mode. One more thing: even if this sound like a good idea, we cannot garantee that we are going to accept your PR. We will have to review your code first. Thanks!

neumantm commented 4 years ago

However, it would be nice if you could build this into a brand new servlet and access point (something like /plantuml/json ) It would allow a clear separation between actual behaviour and the new JSON mode.

Sounds good.

One more thing: even if this sound like a good idea, we cannot garantee that we are going to accept your PR. We will have to review your code first.

Sure

HeinrichAD commented 1 year ago

@neumantm can you let us know if you will still submit the planned PR or not? Is the feature request even up to date?

neumantm commented 1 year ago

Sorry, I never got it to a working state. I think I ended up not using PlantUML for the task because of time pressure. Also I do not currently plan to work on this anymore. As I do not use PlantUML at the moment, I have no concrete need for this feature. However, I still think this is a valuable feature to have. But I'd also understand if you want to close this issue.