001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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            @Override
032            public Group getGroup() throws PortalException, SystemException {
033                    return GroupLocalServiceUtil.getUserGroupGroup(
034                            getCompanyId(), getUserGroupId());
035            }
036    
037            @Override
038            public int getPrivateLayoutsPageCount()
039                    throws PortalException, SystemException {
040    
041                    Group group = getGroup();
042    
043                    return group.getPrivateLayoutsPageCount();
044            }
045    
046            @Override
047            public int getPublicLayoutsPageCount()
048                    throws PortalException, SystemException {
049    
050                    Group group = getGroup();
051    
052                    return group.getPublicLayoutsPageCount();
053            }
054    
055            @Override
056            public boolean hasPrivateLayouts() throws PortalException, SystemException {
057                    if (getPrivateLayoutsPageCount() > 0) {
058                            return true;
059                    }
060                    else {
061                            return false;
062                    }
063            }
064    
065            @Override
066            public boolean hasPublicLayouts() throws PortalException, SystemException {
067                    if (getPublicLayoutsPageCount() > 0) {
068                            return true;
069                    }
070                    else {
071                            return false;
072                    }
073            }
074    
075    }