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