Help: Compressing long markup with a low-code tool

0 votes
asked Nov 17, 2022 in Question / help by Capitán Primate (140 points)
edited Jun 4 by Capitán Primate

I am developing a small application with a low-code tool (Zoho Creator) and I intend to use PlantUML server to automatically generate Gantt diagrams (once a day or so).

It works well, but when the markup reachs a certain size, after converting it to hex and sending it to the server, the following error appears:

Forbidden

You don't have permission to access /plantuml/png/~h<4284 characters long hex string>

on this server.

I assume that this happens because the URL becomes too long.

I decided to send the server a compressed version, but the low-code tool does not have a deflate algorithm; it only has a function to convert a string into a ZIP file, so I tried the following (not very convinced that it would work, though):

  1. Convert the PlantUML markup to ZIP file
  2. Convert the ZIP file to Base64 text
  3. Convert the Base64 text to almost-Base64

Unfortunately (and as expected), I had no luck.

For the following markdown (I use it as a minimum example, since mine gets a lot longer):

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml

I get this after zipping it, converting it to Base64, and finally converting it to almost-Base64:

K4i311G020W80AP6SLK0000000000000000B0000ON9ZQ6bsRrzrRMnpA2v9B2efpStXSip9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuGBAAUW2rO0LOr5LN92VLvpAvP2Qbm8q4m1GImS8xCzb7qW0001T0000K4i10XG0500820W0faPnLUpFPHz80000NG0000i000000000000000000000065oOsXfTczVTMriK4i51W0000010040EG000840000000

Do you know what should I trim from the encoded string in order to make PlantUML server work as expected?

I cannot use any external libraries.

Thanks in advance!

1 Answer

0 votes
answered Nov 17, 2022 by plantuml (295,800 points)

That's a very interesting idea!

The good news is that we were able to read data from your short example K4i311G020W80AP6SLK00....00

We saw that your filename was archivo_uml :-)

So here what we are planning:

Does it sound good?

...