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 portlet preferences remote service. This utility wraps {@link com.liferay.portal.service.impl.PortletPreferencesServiceImpl} 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 PortletPreferencesService
030     * @see com.liferay.portal.service.base.PortletPreferencesServiceBaseImpl
031     * @see com.liferay.portal.service.impl.PortletPreferencesServiceImpl
032     * @generated
033     */
034    public class PortletPreferencesServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortletPreferencesServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static void deleteArchivedPreferences(long portletItemId)
041                    throws com.liferay.portal.kernel.exception.PortalException,
042                            com.liferay.portal.kernel.exception.SystemException {
043                    getService().deleteArchivedPreferences(portletItemId);
044            }
045    
046            public static void restoreArchivedPreferences(long groupId,
047                    com.liferay.portal.model.Layout layout, java.lang.String portletId,
048                    long portletItemId, javax.portlet.PortletPreferences preferences)
049                    throws com.liferay.portal.kernel.exception.PortalException,
050                            com.liferay.portal.kernel.exception.SystemException {
051                    getService()
052                            .restoreArchivedPreferences(groupId, layout, portletId,
053                            portletItemId, preferences);
054            }
055    
056            public static void restoreArchivedPreferences(long groupId,
057                    com.liferay.portal.model.Layout layout, java.lang.String portletId,
058                    com.liferay.portal.model.PortletItem portletItem,
059                    javax.portlet.PortletPreferences preferences)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    getService()
063                            .restoreArchivedPreferences(groupId, layout, portletId,
064                            portletItem, preferences);
065            }
066    
067            public static void restoreArchivedPreferences(long groupId,
068                    java.lang.String name, com.liferay.portal.model.Layout layout,
069                    java.lang.String portletId, javax.portlet.PortletPreferences preferences)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException {
072                    getService()
073                            .restoreArchivedPreferences(groupId, name, layout, portletId,
074                            preferences);
075            }
076    
077            public static void updateArchivePreferences(long userId, long groupId,
078                    java.lang.String name, java.lang.String portletId,
079                    javax.portlet.PortletPreferences preferences)
080                    throws com.liferay.portal.kernel.exception.PortalException,
081                            com.liferay.portal.kernel.exception.SystemException {
082                    getService()
083                            .updateArchivePreferences(userId, groupId, name, portletId,
084                            preferences);
085            }
086    
087            public static PortletPreferencesService getService() {
088                    if (_service == null) {
089                            _service = (PortletPreferencesService)PortalBeanLocatorUtil.locate(PortletPreferencesService.class.getName());
090    
091                            ReferenceRegistry.registerReference(PortletPreferencesServiceUtil.class,
092                                    "_service");
093                            MethodCache.remove(PortletPreferencesService.class);
094                    }
095    
096                    return _service;
097            }
098    
099            public void setService(PortletPreferencesService service) {
100                    MethodCache.remove(PortletPreferencesService.class);
101    
102                    _service = service;
103    
104                    ReferenceRegistry.registerReference(PortletPreferencesServiceUtil.class,
105                            "_service");
106                    MethodCache.remove(PortletPreferencesService.class);
107            }
108    
109            private static PortletPreferencesService _service;
110    }