Example usage for com.liferay.portal.util PropsValues DL_FILE_ENTRY_PREVIEW_ENABLED

List of usage examples for com.liferay.portal.util PropsValues DL_FILE_ENTRY_PREVIEW_ENABLED

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues DL_FILE_ENTRY_PREVIEW_ENABLED.

Prototype

boolean DL_FILE_ENTRY_PREVIEW_ENABLED

To view the source code for com.liferay.portal.util PropsValues DL_FILE_ENTRY_PREVIEW_ENABLED.

Click Source Link

Usage

From source file:com.liferay.portlet.documentlibrary.util.AudioProcessorImpl.java

License:Open Source License

private boolean _hasAudio(FileVersion fileVersion) throws Exception {
    if (!isSupported(fileVersion)) {
        return false;
    }/*from www  .  j  a  v  a2s .c  o m*/

    boolean previewExists = DLStoreUtil.hasFile(fileVersion.getCompanyId(), REPOSITORY_ID,
            getPreviewFilePath(fileVersion));

    if (PropsValues.DL_FILE_ENTRY_PREVIEW_ENABLED && previewExists) {
        return true;
    }

    return false;
}

From source file:com.liferay.portlet.documentlibrary.util.AudioProcessorImpl.java

License:Open Source License

private boolean _isGeneratePreview(FileVersion fileVersion) throws Exception {

    String previewFilePath = getPreviewFilePath(fileVersion);

    if (PropsValues.DL_FILE_ENTRY_PREVIEW_ENABLED
            && !DLStoreUtil.hasFile(fileVersion.getCompanyId(), REPOSITORY_ID, previewFilePath)) {

        return true;
    } else {//w w  w  .j a va  2s.co m
        return false;
    }
}

From source file:com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.java

License:Open Source License

private boolean _hasImages(FileVersion fileVersion) throws Exception {
    if (PropsValues.DL_FILE_ENTRY_PREVIEW_ENABLED) {
        if (!DLStoreUtil.hasFile(fileVersion.getCompanyId(), REPOSITORY_ID,
                getPreviewFilePath(fileVersion, 1))) {

            return false;
        }/*from   w w  w.  j a  v  a  2  s . c  om*/
    }

    if (PropsValues.DL_FILE_ENTRY_THUMBNAIL_ENABLED) {
        if (!hasThumbnail(fileVersion, THUMBNAIL_INDEX_DEFAULT)) {
            return false;
        }
    }

    try {
        if (isCustomThumbnailsEnabled(1)) {
            if (!hasThumbnail(fileVersion, THUMBNAIL_INDEX_CUSTOM_1)) {
                return false;
            }
        }

        if (isCustomThumbnailsEnabled(2)) {
            if (!hasThumbnail(fileVersion, THUMBNAIL_INDEX_CUSTOM_2)) {
                return false;
            }
        }
    } catch (Exception e) {
        _log.error(e, e);
    }

    return true;
}

From source file:com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.java

License:Open Source License

private boolean _isGeneratePreview(FileVersion fileVersion) throws Exception {

    String previewFilePath = getPreviewFilePath(fileVersion, 1);

    if (PropsValues.DL_FILE_ENTRY_PREVIEW_ENABLED
            && !DLStoreUtil.hasFile(fileVersion.getCompanyId(), REPOSITORY_ID, previewFilePath)) {

        return true;
    } else {//from   w w w .j a v  a 2s .c om
        return false;
    }
}

From source file:com.liferay.portlet.documentlibrary.util.VideoProcessorImpl.java

License:Open Source License

private boolean _isGeneratePreview(FileVersion fileVersion, String previewType) throws Exception {

    String previewFilePath = getPreviewFilePath(fileVersion, previewType);

    if (PropsValues.DL_FILE_ENTRY_PREVIEW_ENABLED
            && !DLStoreUtil.hasFile(fileVersion.getCompanyId(), REPOSITORY_ID, previewFilePath)) {

        return true;
    }//from w ww .  j  a v a2s. c  o  m

    return false;
}