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