001    /**
002     * Copyright (c) 2000-2012 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;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the repository remote service. This utility wraps {@link com.liferay.portal.service.impl.RepositoryServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see RepositoryService
030     * @see com.liferay.portal.service.base.RepositoryServiceBaseImpl
031     * @see com.liferay.portal.service.impl.RepositoryServiceImpl
032     * @generated
033     */
034    public class RepositoryServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.RepositoryServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static long addRepository(long groupId, long classNameId,
041                    long parentFolderId, java.lang.String name,
042                    java.lang.String description, java.lang.String portletId,
043                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
044                    com.liferay.portal.service.ServiceContext serviceContext)
045                    throws com.liferay.portal.kernel.exception.PortalException,
046                            com.liferay.portal.kernel.exception.SystemException {
047                    return getService()
048                                       .addRepository(groupId, classNameId, parentFolderId, name,
049                            description, portletId, typeSettingsProperties, serviceContext);
050            }
051    
052            public static void checkRepository(long repositoryId)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    getService().checkRepository(repositoryId);
056            }
057    
058            public static void deleteRepository(long repositoryId)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    getService().deleteRepository(repositoryId);
062            }
063    
064            public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
065                    long repositoryId)
066                    throws com.liferay.portal.kernel.exception.PortalException,
067                            com.liferay.portal.kernel.exception.SystemException {
068                    return getService().getLocalRepositoryImpl(repositoryId);
069            }
070    
071            public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
072                    long folderId, long fileEntryId, long fileVersionId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    return getService()
076                                       .getLocalRepositoryImpl(folderId, fileEntryId, fileVersionId);
077            }
078    
079            public static com.liferay.portal.model.Repository getRepository(
080                    long repositoryId)
081                    throws com.liferay.portal.kernel.exception.PortalException,
082                            com.liferay.portal.kernel.exception.SystemException {
083                    return getService().getRepository(repositoryId);
084            }
085    
086            public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
087                    long repositoryId)
088                    throws com.liferay.portal.kernel.exception.PortalException,
089                            com.liferay.portal.kernel.exception.SystemException {
090                    return getService().getRepositoryImpl(repositoryId);
091            }
092    
093            public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
094                    long folderId, long fileEntryId, long fileVersionId)
095                    throws com.liferay.portal.kernel.exception.PortalException,
096                            com.liferay.portal.kernel.exception.SystemException {
097                    return getService()
098                                       .getRepositoryImpl(folderId, fileEntryId, fileVersionId);
099            }
100    
101            public static java.lang.String[] getSupportedConfigurations(
102                    long classNameId)
103                    throws com.liferay.portal.kernel.exception.SystemException {
104                    return getService().getSupportedConfigurations(classNameId);
105            }
106    
107            public static java.lang.String[] getSupportedParameters(long classNameId,
108                    java.lang.String configuration)
109                    throws com.liferay.portal.kernel.exception.SystemException {
110                    return getService().getSupportedParameters(classNameId, configuration);
111            }
112    
113            public static com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties(
114                    long repositoryId)
115                    throws com.liferay.portal.kernel.exception.PortalException,
116                            com.liferay.portal.kernel.exception.SystemException {
117                    return getService().getTypeSettingsProperties(repositoryId);
118            }
119    
120            public static void updateRepository(long repositoryId,
121                    java.lang.String name, java.lang.String description)
122                    throws com.liferay.portal.kernel.exception.PortalException,
123                            com.liferay.portal.kernel.exception.SystemException {
124                    getService().updateRepository(repositoryId, name, description);
125            }
126    
127            public static RepositoryService getService() {
128                    if (_service == null) {
129                            _service = (RepositoryService)PortalBeanLocatorUtil.locate(RepositoryService.class.getName());
130    
131                            ReferenceRegistry.registerReference(RepositoryServiceUtil.class,
132                                    "_service");
133                            MethodCache.remove(RepositoryService.class);
134                    }
135    
136                    return _service;
137            }
138    
139            public void setService(RepositoryService service) {
140                    MethodCache.remove(RepositoryService.class);
141    
142                    _service = service;
143    
144                    ReferenceRegistry.registerReference(RepositoryServiceUtil.class,
145                            "_service");
146                    MethodCache.remove(RepositoryService.class);
147            }
148    
149            private static RepositoryService _service;
150    }