Hi every one,
I made a vaadin portlet and deploy it to liferay. The user can add a new item when he click the add button a new form is showing and the user have to enter information related to the item he can also upload a png and a jrxml design. My app will show the uploaded png in an embedded component and process the jrxml to transform it into a png, save it to a folder in the system then show it in an embedded component. Every thing work fine when i deploy in tomcat but when i deploy in liferay the images take too long to be shown what could be the problem here is my code to show an image after the upload succed event :
formHeader.getImageUploader().addListener(new SucceededListener() {
@Override
public void uploadSucceeded(SucceededEvent event) {
if (event.getMIMEType().equals("image/png")) {
formBody.setProductImage(event.getFilename());
} else {
getApplication().getMainWindow().showNotification(
"Not a supported File!!",
Notification.TYPE_ERROR_MESSAGE);
}
}
});
Here is the code of the setProductImage method
public void setProductImage(String productImageName) {
this.productImageField
.setSource(getProductFileResources(productImageName));
productImageField.requestRepaint();
}
private FileResource getProductFileResources(String fileName) {
File file = null;
FileResource res = null;
file = new File(MYApplication.getProperties().getProperty("imagesfolder") + fileName);
res = new FileResource(file, getApplication());
res.setCacheTime(0);
return res;
}
productImageField is an Embedded component
please help me im pressed by time thanks in advance