001
014
015 package com.liferay.portlet.expando.util;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.security.auth.CompanyThreadLocal;
019 import com.liferay.portlet.expando.model.ExpandoBridge;
020
021
024 public class ExpandoBridgeFactoryUtil {
025
026 public static ExpandoBridge getExpandoBridge(
027 long companyId, String className) {
028
029 PortalRuntimePermission.checkExpandoBridge(className);
030
031 return getExpandoBridgeFactory().getExpandoBridge(companyId, className);
032 }
033
034 public static ExpandoBridge getExpandoBridge(
035 long companyId, String className, long classPK) {
036
037 PortalRuntimePermission.checkExpandoBridge(className);
038
039 return getExpandoBridgeFactory().getExpandoBridge(
040 companyId, className, classPK);
041 }
042
043
047 public static ExpandoBridge getExpandoBridge(String className) {
048 long companyId = CompanyThreadLocal.getCompanyId();
049
050 return getExpandoBridge(companyId, className);
051 }
052
053
057 public static ExpandoBridge getExpandoBridge(
058 String className, long classPK) {
059
060 long companyId = CompanyThreadLocal.getCompanyId();
061
062 return getExpandoBridge(companyId, className, classPK);
063 }
064
065 public static ExpandoBridgeFactory getExpandoBridgeFactory() {
066 PortalRuntimePermission.checkGetBeanProperty(
067 ExpandoBridgeFactoryUtil.class);
068
069 return _expandoBridgeFactory;
070 }
071
072 public void setExpandoBridgeFactory(
073 ExpandoBridgeFactory expandoBridgeFactory) {
074
075 PortalRuntimePermission.checkSetBeanProperty(getClass());
076
077 _expandoBridgeFactory = expandoBridgeFactory;
078 }
079
080 private static ExpandoBridgeFactory _expandoBridgeFactory;
081
082 }