001    /**
002     * Copyright (c) 2000-2013 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.portlet.social.util;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portlet.social.model.SocialActivityDefinition;
019    
020    import java.util.List;
021    
022    /**
023     * @author Zsolt Berentey
024     */
025    public class SocialConfigurationUtil {
026    
027            public static List<String> getActivityCounterNames() {
028                    return getSocialConfiguration().getActivityCounterNames();
029            }
030    
031            public static List<String> getActivityCounterNames(
032                    boolean transientCounter) {
033    
034                    return getSocialConfiguration().getActivityCounterNames(
035                            transientCounter);
036            }
037    
038            public static List<String> getActivityCounterNames(int ownerType) {
039                    return getSocialConfiguration().getActivityCounterNames(ownerType);
040            }
041    
042            public static List<String> getActivityCounterNames(
043                    int ownerType, boolean transientCounter) {
044    
045                    return getSocialConfiguration().getActivityCounterNames(
046                            ownerType, transientCounter);
047            }
048    
049            public static SocialActivityDefinition getActivityDefinition(
050                    String modelName, int activityType) {
051    
052                    return getSocialConfiguration().getActivityDefinition(
053                            modelName, activityType);
054            }
055    
056            public static List<SocialActivityDefinition> getActivityDefinitions(
057                    String modelName) {
058    
059                    return getSocialConfiguration().getActivityDefinitions(modelName);
060            }
061    
062            public static String[] getActivityModelNames() {
063                    return getSocialConfiguration().getActivityModelNames();
064            }
065    
066            public static SocialConfiguration getSocialConfiguration() {
067                    PortalRuntimePermission.checkGetBeanProperty(
068                            SocialConfigurationUtil.class);
069    
070                    return _socialConfiguration;
071            }
072    
073            public static List<Object> read(ClassLoader classLoader, String[] xmls)
074                    throws Exception {
075    
076                    return getSocialConfiguration().read(classLoader, xmls);
077            }
078    
079            public static void removeActivityDefinition(
080                    SocialActivityDefinition activityDefinition) {
081    
082                    getSocialConfiguration().removeActivityDefinition(activityDefinition);
083            }
084    
085            public void setSocialConfiguration(
086                    SocialConfiguration socialConfiguration) {
087    
088                    PortalRuntimePermission.checkSetBeanProperty(getClass());
089    
090                    _socialConfiguration = socialConfiguration;
091            }
092    
093            private static SocialConfiguration _socialConfiguration;
094    
095    }