Sparx Systems Forum
Pro Cloud Server / Prolaborate / WebEA => PCS General Board => Topic started by: DeBAAT on July 17, 2023, 05:08:31 pm
-
For a project I'm working on, I'm trying to display EA images in a PHP web application.
So far, I've located the information in the t_document table, as also indicated in the post "https://sparxsystems.com/forums/smf/index.php/topic,47559.msg277179.html (https://sparxsystems.com/forums/smf/index.php/topic,47559.msg277179.html)".
The images are also automatically generated with the cloud option as they show in WebEA.
Unfortunately, I cannot decode the string I find in the StrContent column of t_document to show on my PHP page.
It seems to be some string that would render as "image/png" but it doesn't show the image.
Decoding base64 doesn't help either.
Any suggestions are highly appreciated.
-
It's a zip with a file str.dat inside that contains the information.
q.
-
Thanks for the quick reply.
What do you mean with :
a zip with a file str.dat inside
?
Just using gzuncompress($StrContent)
or gzdecode($StrContent)
still doesn't render the image.
Looking at some example data, it looks like the information I receive is base64 encoded (some strings end with "==").
Should I then first do a base64 decode before the dzuncompress is applied?
-
Unzipping does not get the file. You will have to extract the file str.dat (to disk or if PHP offers that to a string). Try to save the binary to a file and you will be able to unzip it with Windoze tools. Helps seeing the obvious...
(Sorry, my last touch with PHP is 20 years or so ago. What a relief ;-)
q.
-
Why create your own PHP website when you can just use ProCloud Server/ Prolaborate?
How much time and effort will you spend translating into cost compared to just purchasing procloud server/prolaborate? Is it worth it?
-
Note you only have the images stored in the database if you have PCS licensed, because it is the only way to use the Worker that continuously create a cache of the recently saved diagrams as images in the database.
And of course, if you have the PCS licensed, maybe you would prefer to use WebEA instead of making you own PHP web app.
-
Pls. ignore my post above. You were talking about the PCS image store. You can't read those since EA's cache uses some proprietary format and (IIRC) only when using PCS.
q.
-
Thanks for the concern about me spending my time ;)
And some reactions:
Note you only have the images stored in the database if you have PCS licensed, because it is the only way to use the Worker that continuously create a cache of the recently saved diagrams as images in the database.
The first part of this statement is not true. The Worker might be indeed only part of the PCS license. However, in the regular client application, there are some options related to Cloud behaviour. One setting enables EA to explicitly store the diagram image every time it is saved by the user. And a button is available to batch create all diagram images.
This could also be concluded from looking at the size of the QEA or EAP files. They are much larger after the batch creation of all images, provided they were not there yet.
I also believe there are even some drawbacks when using the Worker because that may render possibly unwanted results when the diagrams are changed without you intending. I sometimes have it when I turn back to a previously neatly created diagram which now shows some additional connections that were added on other diagrams since the last time I looked at this particular diagram.
Pls. ignore my post above. You were talking about the PCS image store. You can't read those since EA's cache uses some proprietary format and (IIRC) only when using PCS.
Your remark might be valid as I am not talking about the PCS image store. As explained above, these images are generated and stored in the repository, whether you are using PCS or not. There may be however a proprietary format used which is 'decoded' when using the WebEA PCS functionality.
-
My memory about these pictures is faint. I seem to remember having looked into some cache pictures and found them to have some EA-internal format. So I put them in the "may-be-forgotten" chamber in my brain. Since I don't have PCS it's likely (except I was completely dreaming) that they are generated by common means in EA. Sorry about the confusion. I'm old and that's not getting better over time.
q.