Programatically send and receive UML data

About Forums Enhancement Requests Programatically send and receive UML data

Viewing 6 reply threads
  • Author
    Posts
    • #252
      Zoltan Csati
      Guest

      Is it possible to programatically send a PlantText-compatible file and obtain e.g. the translated SVG image through link? I generate a .txt file that can be uploaded to this website and download the created diagram. This works fine, but I would like to make it automatic. Is it possible somehow?

    • #254
      Arwen Vaughan
      Keymaster

      I don’t think sending an actually file is the best way to do this but we can think of something that works better over HTTP perhaps.

      Right now you can use PlantText to do what you ask, but you have to use an HTTP GET request that looks like this for example…

      https://www.planttext.com/plantuml/svg/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80

      The last part of the URL is the “deflated” PlantUML markup for the sample diagram seen below…

      @startuml
      Bob -> Alice : hello
      @enduml

      So, this would work for you but you would need to programatically deflate the PlantUML to a string of text and send it to the URL, using whatever language or software you are familiar with. Deflating code is not really simple and may not exist readily with the tools you are using. If it does then just go for it.

      I could simplify this though by removing the deflating step for you. I could create a URL that you could send an HTTP POST request to, with the PlantUML markup for your diagram in plain text (not deflated), and return to you the diagram image in the response. You would still need to know how to programatically send a POST request with the PlantUML markup text in the body of the request.

      If you are not a programmer, then this is probably too much for you to do on your side. This would be pretty simple for me to do my part on the server side. I will plan on doing it if you think it would be helpful.

      It may take a little time as I am currently working on multiple document support in PlantText first. Just let me know.

    • #256
      Zoltan Csati
      Guest

      I could create a URL that you could send an HTTP POST request to, with the PlantUML markup for your diagram in plain text (not deflated), and return to you the diagram image in the response. You would still need to know how to programatically send a POST request with the PlantUML markup text in the body of the request.

      I am using MATLAB and it promises to be able to sent HTTP POST request according to the documentation.

      If you are not a programmer, then this is probably too much for you to do on your side. This would be pretty simple for me to do my part on the server side. I will plan on doing it if you think it would be helpful.

      Indeed, I am not a programmer. I do scientific computing, but have no background in web stuffs. As mentioned in my other post, I could make it work with installing graphviz and using the plantuml jar file. But my MATLAB code should work on Windows too and I want to avoid that the end user has to install additional programs. That is why I would like to solve the whole conversion (sending uml diagram in text file, perform the conversion through PlantText and download the SVG file) without installation.

    • #274
      Jim Davies
      Guest

      Hi,

      Any progress on a PlantText API please, as hinted at above? That would be great!

    • #281
      Arwen Vaughan
      Keymaster

      Yes actually. I got most of it done over a month ago, but decided to take a break and a vacation from the project. I will be finishing this and the multiple document support and pushing it out in the next week hopefully. It is 95% done in development. I just need to test and push into production. Sorry it has taken a while but I do this work in the evenings mostly.

      It works as described in my previous post. There is a URL that accepts a POST request and the body must contain the PlantUML. The response is the PNG image. I can create another URL for the SVG output if you like?

    • #8540
      Arwen Vaughan
      Keymaster

      OK, I am working on this again and will have it in production soon. I will reply to this thread when it is done.

    • #8776
      Arwen Vaughan
      Keymaster

      OK, it is done and in production. Go to planttext.com and hit F5 to see the new button.

      You can learn how to use it programatically here.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.