001    /**
002     * Copyright (c) 2000-present 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.servlet.taglib.ui;
016    
017    import com.liferay.portal.kernel.servlet.taglib.ui.FormNavigatorConstants;
018    import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
019    import com.liferay.portal.model.Group;
020    import com.liferay.portal.model.Organization;
021    import com.liferay.portal.model.User;
022    
023    /**
024     * @author Pei-Jung Lan
025     */
026    @OSGiBeanProperties(property = {"service.ranking:Integer=20"})
027    public class OrganizationOrganizationSiteFormNavigatorEntry
028            extends BaseOrganizationFormNavigatorEntry {
029    
030            @Override
031            public String getCategoryKey() {
032                    return FormNavigatorConstants.
033                            CATEGORY_KEY_ORGANIZATION_ORGANIZATION_INFORMATION;
034            }
035    
036            @Override
037            public String getKey() {
038                    return "organization-site";
039            }
040    
041            @Override
042            public boolean isVisible(User user, Organization organization) {
043                    if (organization != null) {
044                            Group group = organization.getGroup();
045    
046                            if (group.isSite()) {
047                                    return false;
048                            }
049                    }
050    
051                    return true;
052            }
053    
054            @Override
055            protected String getJspPath() {
056                    return "/html/portlet/users_admin/organization/organization_site.jsp";
057            }
058    
059    }