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.service.impl;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.LayoutRevision;
020    import com.liferay.portal.model.LayoutSetBranch;
021    import com.liferay.portal.security.permission.ActionKeys;
022    import com.liferay.portal.service.ServiceContext;
023    import com.liferay.portal.service.base.LayoutRevisionServiceBaseImpl;
024    import com.liferay.portal.service.permission.GroupPermissionUtil;
025    
026    /**
027     * @author Raymond Aug??
028     * @author Julio Camarero
029     */
030    public class LayoutRevisionServiceImpl extends LayoutRevisionServiceBaseImpl {
031    
032            @Override
033            public LayoutRevision addLayoutRevision(
034                            long userId, long layoutSetBranchId, long layoutBranchId,
035                            long parentLayoutRevisionId, boolean head, long plid,
036                            long portletPreferencesPlid, boolean privateLayout, String name,
037                            String title, String description, String keywords, String robots,
038                            String typeSettings, boolean iconImage, long iconImageId,
039                            String themeId, String colorSchemeId, String wapThemeId,
040                            String wapColorSchemeId, String css, ServiceContext serviceContext)
041                    throws PortalException, SystemException {
042    
043                    LayoutSetBranch layoutSetBranch =
044                            layoutSetBranchPersistence.findByPrimaryKey(layoutSetBranchId);
045    
046                    GroupPermissionUtil.check(
047                            getPermissionChecker(), layoutSetBranch.getGroupId(),
048                            ActionKeys.ADD_LAYOUT_BRANCH);
049    
050                    return layoutRevisionLocalService.addLayoutRevision(
051                            userId, layoutSetBranchId, layoutBranchId, parentLayoutRevisionId,
052                            head, plid, portletPreferencesPlid, privateLayout, name, title,
053                            description, keywords, robots, typeSettings, iconImage, iconImageId,
054                            themeId, colorSchemeId, wapThemeId, wapColorSchemeId, css,
055                            serviceContext);
056            }
057    
058    }