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.portal.kernel.staging;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.model.Group;
019    import com.liferay.portal.model.Layout;
020    import com.liferay.portal.model.LayoutRevision;
021    import com.liferay.portal.model.LayoutSet;
022    import com.liferay.portal.model.LayoutSetBranch;
023    import com.liferay.portal.model.LayoutSetStagingHandler;
024    import com.liferay.portal.model.LayoutStagingHandler;
025    
026    /**
027     * @author Raymond Aug??
028     */
029    public class LayoutStagingUtil {
030    
031            public static LayoutRevision getLayoutRevision(Layout layout) {
032                    return getLayoutStaging().getLayoutRevision(layout);
033            }
034    
035            public static LayoutSetBranch getLayoutSetBranch(LayoutSet layoutSet) {
036                    return getLayoutStaging().getLayoutSetBranch(layoutSet);
037            }
038    
039            public static LayoutSetStagingHandler getLayoutSetStagingHandler(
040                    LayoutSet layoutSet) {
041    
042                    return getLayoutStaging().getLayoutSetStagingHandler(layoutSet);
043            }
044    
045            public static LayoutStaging getLayoutStaging() {
046                    PortalRuntimePermission.checkGetBeanProperty(LayoutStagingUtil.class);
047    
048                    return _layoutStaging;
049            }
050    
051            public static LayoutStagingHandler getLayoutStagingHandler(Layout layout) {
052                    return getLayoutStaging().getLayoutStagingHandler(layout);
053            }
054    
055            public static boolean isBranchingLayout(Layout layout) {
056                    return getLayoutStaging().isBranchingLayout(layout);
057            }
058    
059            public static boolean isBranchingLayoutSet(
060                    Group group, boolean privateLayout) {
061    
062                    return getLayoutStaging().isBranchingLayoutSet(group, privateLayout);
063            }
064    
065            public void setLayoutStaging(LayoutStaging layoutStaging) {
066                    PortalRuntimePermission.checkSetBeanProperty(getClass());
067    
068                    _layoutStaging = layoutStaging;
069            }
070    
071            private static LayoutStaging _layoutStaging;
072    
073    }