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

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

Introduction

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

Prototype

String DL_DEFAULT_DISPLAY_VIEW

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

Click Source Link

Usage

From source file:com.liferay.document.library.web.internal.display.context.logic.DLVisualizationHelper.java

License:Open Source License

public String getDisplayStyle() {
    DLPortletInstanceSettings dlPortletInstanceSettings = _dlRequestHelper.getDLPortletInstanceSettings();

    String[] displayViews = dlPortletInstanceSettings.getDisplayViews();

    String displayStyle = ParamUtil.getString(_dlRequestHelper.getRequest(), "displayStyle");

    if (Validator.isNull(displayStyle)) {
        PortalPreferences portalPreferences = PortletPreferencesFactoryUtil
                .getPortalPreferences(_dlRequestHelper.getLiferayPortletRequest());

        displayStyle = portalPreferences.getValue(DLPortletKeys.DOCUMENT_LIBRARY, "display-style",
                PropsValues.DL_DEFAULT_DISPLAY_VIEW);
    }//from   w w w.j  a va  2 s  .  c o  m

    if (!ArrayUtil.contains(displayViews, displayStyle)) {
        displayStyle = displayViews[0];
    }

    return displayStyle;
}