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.cacheadmin; 029 030import org.opencms.security.CmsRole; 031import org.opencms.ui.FontOpenCms; 032import org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration; 033import org.opencms.ui.apps.I_CmsWorkplaceApp; 034import org.opencms.ui.apps.Messages; 035import org.opencms.ui.apps.cacheadmin.CmsCacheViewApp.Mode; 036import org.opencms.ui.components.OpenCmsTheme; 037 038import java.util.Locale; 039 040import com.vaadin.server.Resource; 041 042/** 043 * Configuration class for the view flex cache app.<p> 044 */ 045public class CmsCacheViewFlexConfiguration extends A_CmsWorkplaceAppConfiguration { 046 047 /** The app id. */ 048 public static final String APP_ID = "cache-admin-view"; 049 050 /** 051 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppCategory() 052 */ 053 @Override 054 public String getAppCategory() { 055 056 return CmsCacheFolder.ID; 057 } 058 059 /** 060 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getAppInstance() 061 */ 062 public I_CmsWorkplaceApp getAppInstance() { 063 064 return new CmsCacheViewApp(Mode.FlexCache); 065 } 066 067 /** 068 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getButtonStyle() 069 */ 070 @Override 071 public String getButtonStyle() { 072 073 return FontOpenCms.HIGHLIGHT.getButtonOverlayStyle() + " " + OpenCmsTheme.BUTTON_OVERLAY_GRAY_LIGHT; 074 } 075 076 /** 077 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getHelpText(java.util.Locale) 078 */ 079 @Override 080 public String getHelpText(Locale locale) { 081 082 return Messages.get().getBundle(locale).key(Messages.GUI_CACHE_VIEW_FLEX_HELP_0); 083 } 084 085 /** 086 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() 087 */ 088 public Resource getIcon() { 089 090 return CmsCacheFolder.ICON; 091 } 092 093 /** 094 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getId() 095 */ 096 public String getId() { 097 098 return APP_ID; 099 } 100 101 /** 102 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getName(java.util.Locale) 103 */ 104 @Override 105 public String getName(Locale locale) { 106 107 return Messages.get().getBundle(locale).key(Messages.GUI_CACHE_VIEW_FLEX_0); 108 } 109 110 /** 111 * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getOrder() 112 */ 113 @Override 114 public int getOrder() { 115 116 return 1; 117 } 118 119 /** 120 * @see org.opencms.ui.apps.A_CmsWorkplaceAppConfiguration#getRequiredRole() 121 */ 122 @Override 123 public CmsRole getRequiredRole() { 124 125 return CmsRole.WORKPLACE_MANAGER; 126 } 127}