001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.ui.apps.unusedcontentfinder; 029 030import org.opencms.file.CmsObject; 031import org.opencms.security.CmsRole; 032import org.opencms.ui.CmsCssIcon; 033import org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration; 034import org.opencms.ui.apps.CmsAppVisibilityStatus; 035import org.opencms.ui.apps.I_CmsWorkplaceApp; 036import org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration; 037import org.opencms.ui.apps.Messages; 038import org.opencms.ui.components.OpenCmsTheme; 039 040import java.util.Locale; 041 042import com.vaadin.server.Resource; 043 044/** 045 * Unused content finder configuration. 046 */ 047public class CmsUnusedContentFinderConfiguration extends A_CmsWorkplaceAppConfiguration { 048 049 /** Id of the app. */ 050 public static final String APP_ID = "unused-content-finder"; 051 052 /** 053 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance() 054 */ 055 @Override 056 public I_CmsWorkplaceApp getAppInstance() { 057 058 return new CmsUnusedContentFinderApp(); 059 } 060 061 /** 062 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getHelpText(java.util.Locale) 063 */ 064 @Override 065 public String getHelpText(Locale locale) { 066 067 return Messages.get().getBundle(locale).key(Messages.GUI_UNUSED_CONTENT_FINDER_HELP_0); 068 } 069 070 /** 071 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() 072 */ 073 @Override 074 public Resource getIcon() { 075 076 return new CmsCssIcon(OpenCmsTheme.DELETE_UNUSED); 077 } 078 079 /** 080 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId() 081 */ 082 @Override 083 public String getId() { 084 085 return APP_ID; 086 } 087 088 /** 089 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getName(java.util.Locale) 090 */ 091 @Override 092 public String getName(Locale locale) { 093 094 return Messages.get().getBundle(locale).key(Messages.GUI_UNUSED_CONTENT_FINDER_TITLE_0); 095 } 096 097 /** 098 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getOrder() 099 */ 100 @Override 101 public int getOrder() { 102 103 return 12; 104 } 105 106 /** 107 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getPriority() 108 */ 109 @Override 110 public int getPriority() { 111 112 return I_CmsWorkplaceAppConfiguration.DEFAULT_PRIORIY; 113 } 114 115 /** 116 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getRequiredRole() 117 */ 118 @Override 119 public CmsRole getRequiredRole() { 120 121 return CmsRole.WORKPLACE_USER; 122 } 123 124 /** 125 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getVisibility(org.opencms.file.CmsObject) 126 */ 127 @Override 128 public CmsAppVisibilityStatus getVisibility(CmsObject cms) { 129 130 return new CmsAppVisibilityStatus(true, true, null); 131 } 132}