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.model.impl;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.SystemException;
19  import com.liferay.portal.model.ColorScheme;
20  import com.liferay.portal.model.Group;
21  import com.liferay.portal.model.LayoutSet;
22  import com.liferay.portal.model.Theme;
23  import com.liferay.portal.service.GroupLocalServiceUtil;
24  import com.liferay.portal.service.ThemeLocalServiceUtil;
25  
26  /**
27   * <a href="LayoutSetImpl.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   * @author Jorge Ferrer
31   */
32  public class LayoutSetImpl extends LayoutSetModelImpl implements LayoutSet {
33  
34      public LayoutSetImpl() {
35      }
36  
37      public Theme getTheme() throws SystemException {
38          return ThemeLocalServiceUtil.getTheme(
39              getCompanyId(), getThemeId(), false);
40      }
41  
42      public ColorScheme getColorScheme() throws SystemException {
43          return ThemeLocalServiceUtil.getColorScheme(
44              getCompanyId(), getTheme().getThemeId(), getColorSchemeId(), false);
45      }
46  
47      public Group getGroup() throws PortalException, SystemException {
48          return GroupLocalServiceUtil.getGroup(getGroupId());
49      }
50  
51      public Theme getWapTheme() throws SystemException {
52          return ThemeLocalServiceUtil.getTheme(
53              getCompanyId(), getWapThemeId(), true);
54      }
55  
56      public ColorScheme getWapColorScheme() throws SystemException {
57          return ThemeLocalServiceUtil.getColorScheme(
58              getCompanyId(), getWapTheme().getThemeId(), getWapColorSchemeId(),
59              true);
60      }
61  
62  }