Package org.openfaces.demo.beans.datatable

Examples of org.openfaces.demo.beans.datatable.Book


        }
        return result;
    }

    public void bookImageUploaded(UploadCompletionEvent uploadCompletionEvent) {
        Book book = Faces.var("book", Book.class);
        List<FileUploadItem> files = uploadCompletionEvent.getFiles();
        FileUploadItem fileUploadItem = files.get(0);
        book.setUploadedCoverImage(fileUploadItem);
        deleteFiles(files);
    }
View Full Code Here


        book.setUploadedCoverImage(fileUploadItem);
        deleteFiles(files);
    }

    public String getBookImageFileSize() {
        Book book = Faces.var("book", Book.class);
        FileUploadItem uploadedCoverImage = book.getUploadedCoverImage();
        if (uploadedCoverImage == null) return "N/A";
        FileUploadStatus status = uploadedCoverImage.getStatus();
        switch (status) {
            case SUCCESSFUL:
                return String.valueOf(book.getBookCoverImage().getFileSize());
            case STOPPED:
                return "<Upload stopped>";
            case FAILED:
                return "<Upload failed>";
            case SIZE_LIMIT_EXCEEDED:
View Full Code Here

                throw new IllegalStateException("Unknown FileUploadStatus enumeration value: " + status);
        }
    }

    public String getBookImageFileName() {
        Book book = Faces.var("book", Book.class);
        FileUploadItem uploadedCoverImage = book.getUploadedCoverImage();
        if (uploadedCoverImage == null) return "N/A";
        return uploadedCoverImage.getFileName();
    }
View Full Code Here

        if (uploadedCoverImage == null) return "N/A";
        return uploadedCoverImage.getFileName();
    }

    public String getFileInfoClass() {
        Book book = Faces.var("book", Book.class);
        return book.getUploadedCoverImage() == null ? "notUploadedInfoText" : "uploadedInfoText";
    }
View Full Code Here

TOP

Related Classes of org.openfaces.demo.beans.datatable.Book

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.