1
14
15 package com.liferay.portal.model.impl;
16
17 import com.liferay.portal.model.Group;
18 import com.liferay.portal.model.Layout;
19 import com.liferay.portal.model.LayoutPrototype;
20 import com.liferay.portal.service.GroupLocalServiceUtil;
21 import com.liferay.portal.service.LayoutLocalServiceUtil;
22
23 import java.util.List;
24
25
30 public class LayoutPrototypeImpl
31 extends LayoutPrototypeModelImpl implements LayoutPrototype {
32
33 public LayoutPrototypeImpl() {
34 }
35
36 public Group getGroup() {
37 Group group = null;
38
39 try {
40 group = GroupLocalServiceUtil.getLayoutPrototypeGroup(
41 getCompanyId(), getLayoutPrototypeId());
42 }
43 catch (Exception e) {
44 }
45
46 return group;
47 }
48
49 public Layout getLayout() {
50 Layout layout = null;
51
52 try {
53 Group group = getGroup();
54
55 if ((group != null) && (group.getPrivateLayoutsPageCount() > 0)) {
56 List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(
57 group.getGroupId(), true);
58
59 layout = layouts.get(0);
60 }
61 }
62 catch (Exception e) {
63 }
64
65 return layout;
66 }
67
68 }