1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.impl;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.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  }