In Classic, I used to be able to use ColumnGenerator to load entities and modify the strings based on the value. Something like this:
@Install(to = "webcamsesTable.ipAddress", subject = "columnGenerator")
private Component webcamTableipAddressColumnGenerator(Webcams webcams) throws MalformedURLException {
Image image = uiComponents.create(Image.class);
if (webcams.getIpAddress().toString().equals("1.1.1.1")) {
try {
Runtime.getRuntime().exec("C:\\ffmpeg\\bin\\ffmpeg.exe -rtsp_transport tcp -i \"rtsp://172.16.27.18:554//user=admin&password=&channel=1&stream=1\" -f image2 -vframes 1 -update 1 C:\\ffmpeg\\1.jpg -y");
image.setSource(FileResource.class).setFile(new File("C:\\ffmpeg\\1.jpg"));
image.setWidth("200px");
image.setHeight("200px");
} catch (MalformedURLException e) {
System.out.println(e);
image.setSource(UrlResource.class).setUrl(new URL("https://www.forbes.com/advisor/wp-content/uploads/2021/04/dogecoin.jpeg-900x510.jpg"));
image.setWidth("200px");
image.setHeight("200px");
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
try {
image.setSource(UrlResource.class).setUrl(new URL("https://www.forbes.com/advisor/wp-content/uploads/2021/04/dogecoin.jpeg-900x510.jpg"));
image.setWidth("200px");
image.setHeight("200px");
} catch (MalformedURLException e) {
System.out.println(e);
}
}
return image;
}
However, that interface is no longer available to install to with FlowUI. How can I accomplish the same thing in JMIX 2?