001    /**
002     * Copyright (c) 2000-2013 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            @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    }