001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.Group;
020    import com.liferay.portal.service.GroupLocalServiceUtil;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     * @author Jorge Ferrer
025     */
026    public class UserGroupImpl extends UserGroupBaseImpl {
027    
028            public UserGroupImpl() {
029            }
030    
031            public Group getGroup() throws PortalException, SystemException {
032                    return GroupLocalServiceUtil.getUserGroupGroup(
033                            getCompanyId(), getUserGroupId());
034            }
035    
036            public int getPrivateLayoutsPageCount()
037                    throws PortalException, SystemException {
038    
039                    Group group = getGroup();
040    
041                    return group.getPrivateLayoutsPageCount();
042            }
043    
044            public boolean hasPrivateLayouts() throws PortalException, SystemException {
045                    if (getPrivateLayoutsPageCount() > 0) {
046                            return true;
047                    }
048                    else {
049                            return false;
050                    }
051            }
052    
053            public int getPublicLayoutsPageCount()
054                    throws PortalException, SystemException {
055    
056                    Group group = getGroup();
057    
058                    return group.getPublicLayoutsPageCount();
059            }
060    
061            public boolean hasPublicLayouts() throws PortalException, SystemException {
062                    if (getPublicLayoutsPageCount() > 0) {
063                            return true;
064                    }
065                    else {
066                            return false;
067                    }
068            }
069    
070    }