001    /**
002     * Copyright (c) 2000-2010 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     */
026    public class FacebookConnectUtil {
027    
028            public static String getAccessTokenURL(long companyId)
029                    throws SystemException {
030    
031                    return getFacebookConnect().getAccessTokenURL(companyId);
032            }
033    
034            public static String getAppId(long companyId) throws SystemException {
035                    return getFacebookConnect().getAppId(companyId);
036            }
037    
038            public static String getAppSecret(long companyId) throws SystemException {
039                    return getFacebookConnect().getAppSecret(companyId);
040            }
041    
042            public static String getAuthURL(long companyId) throws SystemException {
043                    return getFacebookConnect().getAuthURL(companyId);
044            }
045    
046            public static FacebookConnect getFacebookConnect() {
047                    return _facebookConnect;
048            }
049    
050            public static JSONObject getGraphResources(
051                    long companyId, String path, String accessToken, String fields) {
052    
053                    return getFacebookConnect().getGraphResources(
054                            companyId, path, accessToken, fields);
055            }
056    
057            public static String getGraphURL(long companyId) throws SystemException {
058                    return getFacebookConnect().getGraphURL(companyId);
059            }
060    
061            public static String getProfileImageURL(PortletRequest portletRequest) {
062                    return getFacebookConnect().getProfileImageURL(portletRequest);
063            }
064    
065            public static String getRedirectURL(long companyId) throws SystemException {
066                    return getFacebookConnect().getRedirectURL(companyId);
067            }
068    
069            public static boolean isEnabled(long companyId) throws SystemException {
070                    return getFacebookConnect().isEnabled(companyId);
071            }
072    
073            public void setFacebookConnect(FacebookConnect facebookConnect) {
074                    _facebookConnect = facebookConnect;
075            }
076    
077            private static FacebookConnect _facebookConnect;
078    
079    }