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.SystemException;
18  import com.liferay.portal.kernel.log.Log;
19  import com.liferay.portal.kernel.log.LogFactoryUtil;
20  import com.liferay.portal.model.ColorScheme;
21  import com.liferay.portal.model.Group;
22  import com.liferay.portal.model.LayoutSet;
23  import com.liferay.portal.model.Theme;
24  import com.liferay.portal.service.GroupLocalServiceUtil;
25  import com.liferay.portal.service.ThemeLocalServiceUtil;
26  
27  /**
28   * <a href="LayoutSetImpl.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   * @author Jorge Ferrer
32   */
33  public class LayoutSetImpl extends LayoutSetModelImpl implements LayoutSet {
34  
35      public LayoutSetImpl() {
36      }
37  
38      public Theme getTheme() throws SystemException {
39          return ThemeLocalServiceUtil.getTheme(
40              getCompanyId(), getThemeId(), false);
41      }
42  
43      public ColorScheme getColorScheme() throws SystemException {
44          return ThemeLocalServiceUtil.getColorScheme(
45              getCompanyId(), getTheme().getThemeId(), getColorSchemeId(), false);
46      }
47  
48      public Group getGroup() {
49          Group group = null;
50  
51          try {
52              group = GroupLocalServiceUtil.getGroup(getGroupId());
53          }
54          catch (Exception e) {
55              group = new GroupImpl();
56  
57              _log.error(e, e);
58          }
59  
60          return group;
61      }
62  
63      public Theme getWapTheme() throws SystemException {
64          return ThemeLocalServiceUtil.getTheme(
65              getCompanyId(), getWapThemeId(), true);
66      }
67  
68      public ColorScheme getWapColorScheme() throws SystemException {
69          return ThemeLocalServiceUtil.getColorScheme(
70              getCompanyId(), getWapTheme().getThemeId(), getWapColorSchemeId(),
71              true);
72      }
73  
74      private static Log _log = LogFactoryUtil.getLog(LayoutSetImpl.class);
75  
76  }