[
https://issues.apache.org/jira/browse/ISIS-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16159785#comment-16159785
]
Andi Huber commented on ISIS-1616:
----------------------------------
Real world example of THUMBNAIL rendering.
* We have the property _logo_ to store an Image. ISIS provides upload and
download via the UI.
* With the new _Markup_ value type, we may provide a (readonly) thumbnail
preview (_logoPreview_), that we can use even in collection views (tables).
(Don't mind the HtmlBuilder class, it simply does the HTML formatting.)
{code:java}
// - LOGO
@MemberOrder(sequence = "1")
@PropertyLayout(labelPosition=LabelPosition.TOP, hidden=Where.ALL_TABLES)
@Column(allowsNull="true") @Persistent(defaultFetchGroup="false")
@Getter @Setter private Blob logo;
// - LOGO PREVIEW
public Markup getLogoPreview(){
return new Markup(
Optional.ofNullable(getLogo())
.map(blob->new HtmlBuilder()
.img()._class("img-thumb-h24")._srcEmbed(getLogo().getMimeType().toString(),
blob.getBytes()).endln()
.build().toString())
.orElse("-")
);
}
{code}
> Support URLs as a link / "As-is" HTML rendering
> -------------------------------------------------
>
> Key: ISIS-1616
> URL: https://issues.apache.org/jira/browse/ISIS-1616
> Project: Isis
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.14.0
> Reporter: Dan Haywood
> Priority: Minor
> Fix For: 2.1.0
>
> Attachments: Clipboard01.png, Clipboard02.png
>
>
> Reuse Kevin's work, https://github.com/kev-m/isis-wicket-url/
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)