All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.sharing.web.internal.util.AssetRendererSharingUtil Maven / Gradle / Ivy

There is a newer version: 3.0.75
Show newest version
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

package com.liferay.sharing.web.internal.util;

import com.liferay.asset.kernel.AssetRendererFactoryRegistryUtil;
import com.liferay.asset.kernel.model.AssetRenderer;
import com.liferay.asset.kernel.model.AssetRendererFactory;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.sharing.model.SharingEntry;

/**
 * @author Sergio González
 */
public class AssetRendererSharingUtil {

	public static AssetRenderer getAssetRenderer(SharingEntry sharingEntry)
		throws PortalException {

		AssetRendererFactory assetRendererFactory =
			AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(
				sharingEntry.getClassName());

		if (assetRendererFactory == null) {
			return null;
		}

		return assetRendererFactory.getAssetRenderer(sharingEntry.getClassPK());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy