A lot of times the answer to resolve improved GUI experience is to use generated HTML in the Universal GUI in combination with the card-list as this one auto-sizes. However treating VARBINARY columns are troublesome especially with regards to performance. Are there any best practices or tips out there to treat for example uploaded icons for categories?
Page 1 / 1
Hi Freddy,
Using a VARBINARY column should not lead to performance degradation by default. The card list uses an image upload as the left-most segment and should load these via the APPLICATION.download__file]() api call - asynchronously.
The raw binary image data should not be accessible to the end user when the roles are set up in a way that the binary content column for the image upload column is unauthorized. This is practically the default unless you make the content column visible to the user somehow (you can check this via the Explain-task in the roles) or when you use an all-rights role.
Hi Freddy,
Using a VARBINARY column should not lead to performance degradation by default. The card list uses an image upload as the left-most segment and should load these via the APPLICATION.download__file]() api call - asynchronously.
The raw binary image data should not be accessible to the end user when the roles are set up in a way that the binary content column for the image upload column is unauthorized. This is practically the default unless you make the content column visible to the user somehow (you can check this via the Explain-task in the roles) or when you use an all-rights role.
Hi Anne,
Point is that you would want to show these images as an inline preview in for example an HTML field in the main card list and then you cannot use this API.
And as the HTML component is very limited, what would be the best solution to show a question with a screenshot preview?
As a reminder, making this available as Freddy describes would still be a work around in my poit of view for the use of a real html wysiwyg editor, as this one you use in the forum:
Do you have any information about the improvements of the html field in the universal?
Improving the editor to embed images will go a long way, indeed.
For now, there are two ways to go about embedding a file upload in a html control. Base64 and API link.
The former is easier, more robust and the latter is more performant.
You can create a html-control column that uses an expression to embed the image.
Base64:
-- Assuming img_upload as image upload column and img_data as binary data column -- Assuming subject_with_cardlist as table select concat('<img src="data:image/', case when t1.img_upload like '%.png' then 'png' when t1.img_upload like '%.svg' then 'svg' when t1.img_upload like '%.jpg' then 'jpg' --etc end, ';base64,', cast('' as xml).value('xs:base64Binary(sql:column("t1.img_data"))', 'varchar(max)'), '">') as base64_html from subject_with_cardlist t1
API link:
-- Assuming subject_with_cardlist as table -- Assuming ../indicium/iam/product/ as relative URL from universal -- Assuming SOME_PROJECT is the project -- Assuming id as singular primary key -- Assuming img_upload as image upload column select concat('<img src=../indicium/iam/product/subject_with_cardlist(', t1.id, ')/SOME_PROJECT.download_img_upload(file_id=null)>') as api_link_html from subject_with_cardlist t1
The second one has a lot more variables that can break (for instance, when deploying to another environment.
Thanks @Anne Buit , de API link will be the preferred solution in this case. However I still hope that the HTML editor will be come more rich on short term :)