Example usage for com.liferay.portal.kernel.util PropsKeys ASSET_RENDERER_ENABLED

List of usage examples for com.liferay.portal.kernel.util PropsKeys ASSET_RENDERER_ENABLED

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys ASSET_RENDERER_ENABLED.

Prototype

String ASSET_RENDERER_ENABLED

To view the source code for com.liferay.portal.kernel.util PropsKeys ASSET_RENDERER_ENABLED.

Click Source Link

Usage

From source file:com.liferay.portlet.PortletBagFactory.java

License:Open Source License

protected List<AssetRendererFactory> newAssetRendererFactoryInstances(Portlet portlet) throws Exception {

    List<AssetRendererFactory> assetRendererFactoryInstances = new ArrayList<AssetRendererFactory>();

    for (String assetRendererFactoryClass : portlet.getAssetRendererFactoryClasses()) {

        String assetRendererEnabledPropertyKey = PropsKeys.ASSET_RENDERER_ENABLED + assetRendererFactoryClass;

        String assetRendererEnabledPropertyValue = null;

        if (_warFile) {
            assetRendererEnabledPropertyValue = getPluginPropertyValue(assetRendererEnabledPropertyKey);
        } else {//  w  ww. j  a v a 2s . c  o m
            assetRendererEnabledPropertyValue = PropsUtil.get(assetRendererEnabledPropertyKey);
        }

        boolean assetRendererEnabledValue = GetterUtil.getBoolean(assetRendererEnabledPropertyValue, true);

        if (assetRendererEnabledValue) {
            AssetRendererFactory assetRendererFactoryInstance = newAssetRendererFactoryInstance(portlet,
                    assetRendererFactoryClass);

            assetRendererFactoryInstances.add(assetRendererFactoryInstance);
        }
    }

    return assetRendererFactoryInstances;
}