Open neumantm opened 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.
I'll start working on PR.
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!
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
@neumantm can you let us know if you will still submit the planned PR or not? Is the feature request even up to date?
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.
It would be great if there was a way to compile a project containing multiple files, that include each other.