[ https://issues.apache.org/jira/browse/CAUSEWAY-3889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andi Huber reopened CAUSEWAY-3889: ---------------------------------- Unfortunately with simply reusing iconName for icon image embedding as showcased above, there is a design flaw. That is, domain object icons need to appear in 2 different sizes, depending on the rendering context (either in object-detail page heads or in tables). For site performance reasons it is crucial to send as little image data over the wire as possible, which for the table case means we really want small embedded image data e.g. 40x30 px. So I will do a redesign of the programming model, something along: {code:java} import org.apache.causeway.commons.net.DataUri; class SomeDomainObject { @ObjectSupport public DataUri iconData(Where where) { BufferedImage icon = ... // custom size as governed by 'where' return DataUri.embeddedImage(DataUri.ImageType.PNG, icon); } } {code} .. with Where perhaps an enum of {DETAIL, TABLE}, so developers can serve appropriate image data sizes according to the rendering context. > Support for Domain Object Icon Image Embedding > ---------------------------------------------- > > Key: CAUSEWAY-3889 > URL: https://issues.apache.org/jira/browse/CAUSEWAY-3889 > Project: Causeway > Issue Type: New Feature > Components: Applib (programming model), Viewer Wicket > Reporter: Andi Huber > Assignee: Andi Huber > Priority: Major > Fix For: 4.0.0 > > > The `String iconName()` object support method is currently used to > programmatically provide an icon name suffix. > However, without breaking this use, we could also support image embedding. > E.g. by detecting a string magic like > data:[<media-type>][;base64],<data> > resembling the *data* URL format from > https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data > -- This message was sent by Atlassian Jira (v8.20.10#820010)