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.model.UserGroup;
021    import com.liferay.portal.service.GroupLocalServiceUtil;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Jorge Ferrer
026     */
027    public class UserGroupImpl extends UserGroupModelImpl implements UserGroup {
028    
029            public UserGroupImpl() {
030            }
031    
032            public Group getGroup() throws PortalException, SystemException {
033                    return GroupLocalServiceUtil.getUserGroupGroup(
034                            getCompanyId(), getUserGroupId());
035            }
036    
037            public int getPrivateLayoutsPageCount()
038                    throws PortalException, SystemException {
039    
040                    Group group = getGroup();
041    
042                    return group.getPrivateLayoutsPageCount();
043            }
044    
045            public boolean hasPrivateLayouts() throws PortalException, SystemException {
046                    if (getPrivateLayoutsPageCount() > 0) {
047                            return true;
048                    }
049                    else {
050                            return false;
051                    }
052            }
053    
054            public int getPublicLayoutsPageCount()
055                    throws PortalException, SystemException {
056    
057                    Group group = getGroup();
058    
059                    return group.getPublicLayoutsPageCount();
060            }
061    
062            public boolean hasPublicLayouts() throws PortalException, SystemException {
063                    if (getPublicLayoutsPageCount() > 0) {
064                            return true;
065                    }
066                    else {
067                            return false;
068                    }
069            }
070    
071    }