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.model.impl;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
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() {
38          return ThemeLocalServiceUtil.getTheme(
39              getCompanyId(), getThemeId(), false);
40      }
41  
42      public ColorScheme getColorScheme() {
43          return ThemeLocalServiceUtil.getColorScheme(
44              getCompanyId(), getTheme().getThemeId(), getColorSchemeId(), false);
45      }
46  
47      public Group getGroup() {
48          Group group = null;
49  
50          try {
51              group = GroupLocalServiceUtil.getGroup(getGroupId());
52          }
53          catch (Exception e) {
54              group = new GroupImpl();
55  
56              _log.error(e, e);
57          }
58  
59          return group;
60      }
61  
62      public Theme getWapTheme() {
63          return ThemeLocalServiceUtil.getTheme(
64              getCompanyId(), getWapThemeId(), true);
65      }
66  
67      public ColorScheme getWapColorScheme() {
68          return ThemeLocalServiceUtil.getColorScheme(
69              getCompanyId(), getWapTheme().getThemeId(), getWapColorSchemeId(),
70              true);
71      }
72  
73      private static Log _log = LogFactoryUtil.getLog(LayoutSetImpl.class);
74  
75  }