001    /**
002     * Copyright (c) 2000-2011 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.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    }