001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class ResourceFinderUtil {
024            public static java.util.List<com.liferay.portal.model.Resource> findByContainerResource(
025                    long codeId, long classNameId)
026                    throws com.liferay.portal.kernel.exception.SystemException {
027                    return getFinder().findByContainerResource(codeId, classNameId);
028            }
029    
030            public static java.util.List<com.liferay.portal.model.Resource> findByName(
031                    java.lang.String name)
032                    throws com.liferay.portal.kernel.exception.SystemException {
033                    return getFinder().findByName(name);
034            }
035    
036            public static java.util.List<com.liferay.portal.model.Resource> findByNoActions(
037                    long codeId, java.lang.String actionId)
038                    throws com.liferay.portal.kernel.exception.SystemException {
039                    return getFinder().findByNoActions(codeId, actionId);
040            }
041    
042            public static java.util.List<com.liferay.portal.model.Resource> findByC_P(
043                    long companyId, java.lang.String primKey)
044                    throws com.liferay.portal.kernel.exception.SystemException {
045                    return getFinder().findByC_P(companyId, primKey);
046            }
047    
048            public static java.util.List<com.liferay.portal.model.Resource> findByN_S(
049                    java.lang.String name, int scope)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getFinder().findByN_S(name, scope);
052            }
053    
054            public static ResourceFinder getFinder() {
055                    if (_finder == null) {
056                            _finder = (ResourceFinder)PortalBeanLocatorUtil.locate(ResourceFinder.class.getName());
057    
058                            ReferenceRegistry.registerReference(ResourceFinderUtil.class,
059                                    "_finder");
060                    }
061    
062                    return _finder;
063            }
064    
065            public void setFinder(ResourceFinder finder) {
066                    _finder = finder;
067    
068                    ReferenceRegistry.registerReference(ResourceFinderUtil.class, "_finder");
069            }
070    
071            private static ResourceFinder _finder;
072    }