1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.impl;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.SystemException;
19  import com.liferay.portal.model.LayoutSet;
20  import com.liferay.portal.model.Plugin;
21  import com.liferay.portal.security.permission.ActionKeys;
22  import com.liferay.portal.service.base.LayoutSetServiceBaseImpl;
23  import com.liferay.portal.service.permission.GroupPermissionUtil;
24  
25  import java.io.File;
26  
27  /**
28   * <a href="LayoutSetServiceImpl.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   */
32  public class LayoutSetServiceImpl extends LayoutSetServiceBaseImpl {
33  
34      public void updateLogo(
35              long groupId, boolean privateLayout, boolean logo, File file)
36          throws PortalException, SystemException {
37  
38          GroupPermissionUtil.check(
39              getPermissionChecker(), groupId, ActionKeys.MANAGE_LAYOUTS);
40  
41          layoutSetLocalService.updateLogo(groupId, privateLayout, logo, file);
42      }
43  
44      public LayoutSet updateLookAndFeel(
45              long groupId, boolean privateLayout, String themeId,
46              String colorSchemeId, String css, boolean wapTheme)
47          throws PortalException, SystemException {
48  
49          GroupPermissionUtil.check(
50              getPermissionChecker(), groupId, ActionKeys.MANAGE_LAYOUTS);
51  
52          pluginSettingLocalService.checkPermission(
53              getUserId(), themeId, Plugin.TYPE_THEME);
54  
55          return layoutSetLocalService.updateLookAndFeel(
56              groupId, privateLayout, themeId, colorSchemeId, css, wapTheme);
57      }
58  
59      public LayoutSet updateVirtualHost(
60              long groupId, boolean privateLayout, String virtualHost)
61          throws PortalException, SystemException {
62  
63          GroupPermissionUtil.check(
64              getPermissionChecker(), groupId, ActionKeys.UPDATE);
65  
66          return layoutSetLocalService.updateVirtualHost(
67              groupId, privateLayout, virtualHost);
68      }
69  
70  }