001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.facebook;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.kernel.json.JSONObject;
019    
020    import javax.portlet.PortletRequest;
021    
022    /**
023     * @author Wilson Man
024     * @author Brian Wing Shun Chan
025     * @author Mika Koivisto
026     */
027    public class FacebookConnectUtil {
028    
029            public static String getAccessToken(
030                            long companyId, String redirect, String code)
031                    throws SystemException {
032    
033                    return getFacebookConnect().getAccessToken(companyId, redirect, code);
034            }
035    
036            public static String getAccessTokenURL(long companyId)
037                    throws SystemException {
038    
039                    return getFacebookConnect().getAccessTokenURL(companyId);
040            }
041    
042            public static String getAppId(long companyId) throws SystemException {
043                    return getFacebookConnect().getAppId(companyId);
044            }
045    
046            public static String getAppSecret(long companyId) throws SystemException {
047                    return getFacebookConnect().getAppSecret(companyId);
048            }
049    
050            public static String getAuthURL(long companyId) throws SystemException {
051                    return getFacebookConnect().getAuthURL(companyId);
052            }
053    
054            public static FacebookConnect getFacebookConnect() {
055                    return _facebookConnect;
056            }
057    
058            public static JSONObject getGraphResources(
059                    long companyId, String path, String accessToken, String fields) {
060    
061                    return getFacebookConnect().getGraphResources(
062                            companyId, path, accessToken, fields);
063            }
064    
065            public static String getGraphURL(long companyId) throws SystemException {
066                    return getFacebookConnect().getGraphURL(companyId);
067            }
068    
069            public static String getProfileImageURL(PortletRequest portletRequest) {
070                    return getFacebookConnect().getProfileImageURL(portletRequest);
071            }
072    
073            public static String getRedirectURL(long companyId) throws SystemException {
074                    return getFacebookConnect().getRedirectURL(companyId);
075            }
076    
077            public static boolean isEnabled(long companyId) throws SystemException {
078                    return getFacebookConnect().isEnabled(companyId);
079            }
080    
081            public void setFacebookConnect(FacebookConnect facebookConnect) {
082                    _facebookConnect = facebookConnect;
083            }
084    
085            private static FacebookConnect _facebookConnect;
086    
087    }